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
parent 452b7d12d0
commit 726e522434
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);
}
]);
})();