From 22f9120d544195d30ac115f4e086c6305c1c11dc Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 26 Apr 2018 16:26:00 -0400 Subject: fixed issue while doing logout --- www/js/DataModel.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'www') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index ee807100..8c2ba754 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -952,14 +952,10 @@ angular.module('zmApp.controllers') if (typeof loginData.disableSimulStreaming == 'undefined') { - loginData.disableSimulStreaming = false; - + loginData.disableSimulStreaming = ($rootScope.platformOS == 'ios')?true:false; + } - // iOS it is always off, webkit bug - - if ($rootScope.platformOS=='ios') { - loginData.disableSimulStreaming = true; - } + if (typeof loginData.exitOnSleep == 'undefined') { debug("exitOnSleep does not exist. Setting to false"); @@ -1253,17 +1249,25 @@ angular.module('zmApp.controllers') }, stopNetwork: function (str) { + var d = $q.defer(); var s = ""; if (str) s = str + ":"; if (justResumed) { // we don't call stop as we did stop on pause log(s + " Not calling window stop as we just resumed"); + d.resolve (true); + return (d.promise); } else { log(s + " stopNework: Calling window.stop()"); - $timeout (function() {window.stop();}); + $timeout (function() { + window.stop(); + d.resolve(true); + return (d.promise); + }); } + return d.promise; }, hasLoginInfo: function () { @@ -2423,10 +2427,12 @@ angular.module('zmApp.controllers') }, logout: function () { + + var d = $q.defer(); log (loginData.url +"=>Logging out of any existing ZM sessions..."); $rootScope.authSession = "undefined"; - return $http( + $http( { method: 'POST', timeout:10000, @@ -2452,7 +2458,10 @@ angular.module('zmApp.controllers') action: "logout", view: "login" } - }); + }) + .then (function (succ) {d.resolve(true);return d.promise;}, + function (err) {d.resolve(true);return d.promise;}); + return d.promise; } -- cgit v1.2.3