diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-07-25 14:07:41 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-07-25 14:07:41 -0400 |
| commit | 72506316bccef298f82040e8531e538cf47bbf54 (patch) | |
| tree | 93cb7529a0a9f8b041d040fed73cc2082431dd7e /www/js/DataModel.js | |
| parent | fc76a4a8612338e988466a0f398cca9ccb457370 (diff) | |
fix currentServerVersion persistency
Diffstat (limited to 'www/js/DataModel.js')
| -rwxr-xr-x | www/js/DataModel.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index ee0603e5..49fb2460 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -15,7 +15,6 @@ angular.module('zmApp.controllers') $ionicPopup, $localstorage, $state, $ionicNativeTransitions, $translate) { var currentServerMultiPortSupported = false; - var currentServerVersion = ''; var zmAppVersion = "unknown"; var isBackground = false; @@ -178,6 +177,7 @@ angular.module('zmApp.controllers') 'insertBasicAuthToken': false, 'loginAPISupported': false, 'montageResizeSteps': 5, + 'currentServerVersion': '', }; @@ -349,10 +349,10 @@ angular.module('zmApp.controllers') return d.promise; } - if (currentServerVersion && (versionCompare(currentServerVersion, zm.versionWithLoginAPI) != -1 || loginData.loginAPISupported)) { + if (loginData.currentServerVersion && (versionCompare(loginData.currentServerVersion, zm.versionWithLoginAPI) != -1 || loginData.loginAPISupported)) { myurl = loginData.apiurl + '/host/getCredentials.json'; - debug("Server version " + currentServerVersion+ " > 1.31.41, so using getCredentials API:" + myurl); + debug("Server version " + loginData.currentServerVersion+ " > 1.31.41, so using getCredentials API:" + myurl); $http.get(myurl) .then(function (s) { @@ -594,7 +594,8 @@ angular.module('zmApp.controllers') } function setCurrentServerVersion(val) { - currentServerVersion = val; + loginData.currentServerVersion = val; + setLogin(loginData); debug("Setting server version to:" + val); } @@ -626,7 +627,7 @@ angular.module('zmApp.controllers') }, getCurrentServerVersion: function () { - return (currentServerVersion); + return (loginData.currentServerVersion); }, @@ -2648,9 +2649,9 @@ angular.module('zmApp.controllers') $rootScope.authSession = "undefined"; -// console.log ("CURRENT SERVER: "+currentServerVersion); + console.log ("CURRENT SERVER: "+loginData.currentServerVersion); - if (currentServerVersion && (versionCompare(currentServerVersion, zm.versionWithLoginAPI) != -1 || loginData.loginAPISupported)) { + if (loginData.currentServerVersion && (versionCompare(loginData.currentServerVersion, zm.versionWithLoginAPI) != -1 || loginData.loginAPISupported)) { debug ("Logging out using API method"); $http.get(loginData.apiurl+'/host/logout.json') |
