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

View File

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