From f01c85743cf9d1ae9f45174c60ee3b27f75e4d85 Mon Sep 17 00:00:00 2001 From: Joao Mesquita Date: Mon, 24 Aug 2015 13:29:55 -0300 Subject: [PATCH] FS-7995 [verto_communicator] #resolve upon call recovery, emit an event on $rootScope so that controllers are able to properly clear states.Right now clearing chat state. --- html5/verto/verto_communicator/js/controllers.js | 5 +++++ html5/verto/verto_communicator/js/verto-service.js | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/html5/verto/verto_communicator/js/controllers.js b/html5/verto/verto_communicator/js/controllers.js index 9b10bb6434..f2f5f0e1b5 100644 --- a/html5/verto/verto_communicator/js/controllers.js +++ b/html5/verto/verto_communicator/js/controllers.js @@ -507,6 +507,11 @@ vertoControllers.controller('ChatController', ['$scope', '$rootScope', '$http', }); }); + $rootScope.$on('call.recovering', function(event){ + console.log('Our current call is recovering, clear the participant list.'); + $scope.members = []; + }); + function findMemberByUUID(uuid) { var found = false; for (var idx in $scope.members) { diff --git a/html5/verto/verto_communicator/js/verto-service.js b/html5/verto/verto_communicator/js/verto-service.js index 87b93b73f3..1a1acfe004 100644 --- a/html5/verto/verto_communicator/js/verto-service.js +++ b/html5/verto/verto_communicator/js/verto-service.js @@ -170,6 +170,10 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora $rootScope.$emit('call.incoming', number); } + function recoveringCall() { + $rootScope.$emit('call.recovering'); + } + function getVideoParams() { var maxWidth, maxHeight; @@ -500,6 +504,10 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora data.callState = 'active'; calling(); break; + case "recovering": + console.debug('We are recovering a call!'); + recoveringCall(); + break; case "active": console.debug('Talking to:', d.cidString()); data.callState = 'active';