diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-12-24 17:33:18 -0500 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-12-24 17:33:18 -0500 |
| commit | bff6127032bd5155e4f9715d08b9693b5a2af913 (patch) | |
| tree | b3fbf02bdebaa22cfdfdb267c9e5ecd5c9099bed /www/js/app.js | |
| parent | 2ebe8c3c3e4abacda72186c0b28233b036bd4fab (diff) | |
#122 - you can cancel auth attempts and go directly to login
Former-commit-id: 874cf34492aa09f69952a81c29626a9997f63602
Diffstat (limited to 'www/js/app.js')
| -rw-r--r-- | www/js/app.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/www/js/app.js b/www/js/app.js index ab2d5f90..5b536932 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -89,6 +89,7 @@ angular.module('zmApp', [ }) + //------------------------------------------------------------------ // I use this factory to share data between carousel and lazy load // carousel will not progress autoslide till imageLoading is 0 or -1 @@ -591,7 +592,7 @@ angular.module('zmApp', [ //==================================================================== -.run(function ($ionicPlatform, $ionicPopup, $rootScope, zm, $state, $stateParams, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin, zmCheckUpdates, $fileLogger, $timeout, $ionicHistory, $window, $ionicSideMenuDelegate, EventServer,$ionicContentBanner) { +.run(function ($ionicPlatform, $ionicPopup, $rootScope, zm, $state, $stateParams, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin, zmCheckUpdates, $fileLogger, $timeout, $ionicHistory, $window, $ionicSideMenuDelegate, EventServer,$ionicContentBanner, $ionicLoading) { @@ -612,6 +613,7 @@ angular.module('zmApp', [ $rootScope.currentServerGroup = "defaultServer"; $rootScope.validMonitorId = ""; $rootScope.newVersionAvailable = ""; + $rootScope.userCancelledAuth = false; //$rootScope.minAlarmCount = "1"; @@ -650,6 +652,22 @@ angular.module('zmApp', [ window.addEventListener("resize", checkOrientation, false); + + // we come here when a user forcibly cancels portal auth + // useful when you know your auth won't succeed and you need to + // switch to another server + $rootScope.cancelAuth = function() + { + $ionicLoading.hide(); + ZMDataModel.zmLog("User cancelled login"); + $ionicHistory.nextViewOptions({ + disableAnimate: true, + disableBack: true + }); + $state.go("login"); + $rootScope.userCancelledAuth = true; + }; + //--------------------------------------------------------------------------- // authorize state transitions //---------------------------------------------------------------------------- @@ -694,6 +712,9 @@ angular.module('zmApp', [ $ionicPlatform.ready(function () { $rootScope.platformOS = "desktop"; + + + ZMDataModel.zmLog("Device is ready"); var ld = ZMDataModel.getLogin(); |
