2014-07-10 08:24:06 +03:00
|
|
|
'use strict';
|
|
|
|
|
2014-10-28 17:16:50 +02:00
|
|
|
angular.module('app').controller("SyncController", function($scope, $http, $interval, $location, $routeParams, users) {
|
|
|
|
var return_to = $routeParams.return_to
|
2014-07-11 08:41:11 +03:00
|
|
|
var stop = $interval(function() {
|
2014-07-14 06:24:03 +03:00
|
|
|
// todo(bradrydzewski) We should poll the user to see if the
|
|
|
|
// sync process is complete, using the user.syncing variable.
|
2014-07-11 08:41:11 +03:00
|
|
|
$interval.cancel(stop);
|
2014-10-28 17:16:50 +02:00
|
|
|
if (return_to != undefined) {
|
|
|
|
$location.$$search = {}
|
|
|
|
$location.path(return_to);
|
|
|
|
} else {
|
|
|
|
$location.path("/");
|
|
|
|
}
|
2014-07-10 08:24:06 +03:00
|
|
|
}, 5000);
|
|
|
|
});
|