diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-06-16 12:24:58 -0400 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-06-16 12:24:58 -0400 |
| commit | 2bee0d32cb046485adcbd15f8607440b2265a366 (patch) | |
| tree | e328e2b30f30bb78fe585fe888d23a33bdaeb01d | |
| parent | d11ef1b18884bfb6b8f988e6c73f6c179342f8f1 (diff) | |
added reachability toggle, but not using it for now
Former-commit-id: 892595bd1add897dd7955547e56870fb690053c0
| -rw-r--r-- | www/js/DataModel.js | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index ab4326c9..d0175522 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -84,7 +84,8 @@ angular.module('zmApp.controllers') 'packerySizes':'', 'timelineModalGraphType':'all', 'resumeDelay':300, - 'language':'en' + 'language':'en', + 'reachability':true, @@ -338,14 +339,25 @@ angular.module('zmApp.controllers') { $ionicLoading.show({template: $translate.instant('kTrying') + ' ' +urls[0].server}); zmLog ("Reachability test.." + urls[0].url); - return $http.get(urls[0].url).then(function () { - zmLog ("Success: reachability on "+ urls[0].url); - $ionicLoading.hide(); + + if (loginData.reachability) + { + + //console.log ("************* AUGH"); + return $http.get(urls[0].url).then(function () { + zmLog ("Success: reachability on "+ urls[0].url); + $ionicLoading.hide(); + return urls[0]; + }, function(err) { + zmLog ("Failed reachability on "+ urls[0].url+ " with error " + JSON.stringify(err)); + return findFirstReachableUrl(urls.slice(1)); + }); + } + else + { + zmLog ("Reachability is disabled in config, faking this test and returning success on " + urls[0]); return urls[0]; - }, function(err) { - zmLog ("Failed reachability on "+ urls[0].url+ " with error " + JSON.stringify(err)); - return findFirstReachableUrl(urls.slice(1)); - }); + } } else { @@ -438,6 +450,14 @@ angular.module('zmApp.controllers') loginData.useNphZmsForEvents = true; } + if (typeof loginData.reachability == 'undefined') + { + zmDebug ("reachability does not exist. Setting to true"); + loginData.reachability = true; + } + // force it - this may not be the problem + loginData.reachability = true; + // and now, force enable it loginData.useNphZms = true; loginData.useNphZmsForEvents = true; |
