From: Italo Rossi Date: Tue, 26 Dec 2017 17:40:56 +0000 (-0300) Subject: FS-10858 - [verto_communicator] Removing emit of res_check_done, on slow connections... X-Git-Tag: v1.8.1~3^2~255 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=452b7d12d0fb72a93e9d7cb6fe1aca82ff5130bc;p=thirdparty%2Ffreeswitch.git FS-10858 - [verto_communicator] Removing emit of res_check_done, on slow connections the emit could happen before the listening thus freezing the app on loading --- diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js index 43ceeae092..0dfee15801 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js @@ -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); } ]); })(); diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index 3e083bfe19..808aba539c 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -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.');