]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10858 - [verto_communicator] cancel timeout when done to avoid redirect loop
authorItalo Rossi <italorossib@gmail.com>
Thu, 28 Dec 2017 20:36:35 +0000 (17:36 -0300)
committerItalo Rossi <italorossib@gmail.com>
Thu, 28 Dec 2017 20:36:35 +0000 (17:36 -0300)
html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js

index 0dfee15801b8b4c21b83b78cbd97c1d64aebd0b6..9aaeb6e20e1d1d86ada642bb31bc4d46cad41a8c 100644 (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);
+
             }
         ]);
 })();