FS-10858 - [verto_communicator] cancel timeout when done to avoid redirect loop

This commit is contained in:
Italo Rossi 2017-12-28 17:36:35 -03:00 committed by Mike Jerris
parent 1b900cc050
commit 3188997b73
1 changed files with 12 additions and 4 deletions

View File

@ -6,11 +6,19 @@
.controller('LoadingController', ['$rootScope', '$scope', '$location', '$interval', 'verto',
function($rootScope, $scope, $location, $interval, verto) {
console.log('Loading controller');
$interval(function() {
if (verto.data.resCheckEnded) {
$location.path('/preview');
}
var int_id;
$scope.stopInterval = function() {
$interval.cancel(int_id);
};
int_id = $interval(function() {
if (verto.data.resCheckEnded) {
$scope.stopInterval();
$location.path('/preview');
}
}, 1000);
}
]);
})();