]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10858 - [verto_communicator] Removing emit of res_check_done, on slow connections...
authorItalo Rossi <italorossib@gmail.com>
Tue, 26 Dec 2017 17:40:56 +0000 (14:40 -0300)
committerItalo Rossi <italorossib@gmail.com>
Tue, 26 Dec 2017 17:41:08 +0000 (14:41 -0300)
html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js
html5/verto/verto_communicator/src/vertoService/services/vertoService.js

index 43ceeae092b8c4256498fd760b8bb1604563b38c..0dfee15801b8b4c21b83b78cbd97c1d64aebd0b6 100644 (file)
@@ -3,12 +3,14 @@
 
     angular
         .module('vertoControllers')
-        .controller('LoadingController', ['$rootScope', '$scope', '$location',
-            function($rootScope, $scope, $location) {
+        .controller('LoadingController', ['$rootScope', '$scope', '$location', '$interval', 'verto',
+            function($rootScope, $scope, $location, $interval, verto) {
                 console.log('Loading controller');
-                $rootScope.$on('res_check_done', function() {
-                    $location.path('/preview');
-                });
+                $interval(function() {
+                    if (verto.data.resCheckEnded) {
+                      $location.path('/preview');
+                    }
+                }, 1000);
             }
         ]);
 })();
index 3e083bfe19b2f48aaa52de2d1d9cb1fcc3a07a5f..808aba539c8a58ad5dee52c2c3011c4b62e6933d 100644 (file)
@@ -174,7 +174,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
       login: $cookieStore.get('verto_demo_login') || "1008",
       password: $cookieStore.get('verto_demo_passwd') || "1234",
       hostname: window.location.hostname,
-      wsURL: ("wss://" + window.location.hostname + ":8082")
+      wsURL: ("wss://" + window.location.hostname + ":8082"),
+      resCheckEnded: false
     };
 
     function cleanShareCall(that) {
@@ -448,7 +449,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
             }
 
           });
-          $rootScope.$emit('res_check_done');
+          data.resCheckEnded = true;
 
         } else {
           console.debug('There is no instance of verto.');