summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2020-05-11 09:37:21 -0400
committerPliable Pixels <pliablepixels@gmail.com>2020-05-11 09:37:21 -0400
commitadaaec08f156c45a06f76741d12a437b32a36053 (patch)
treefd96e07b8a490fc834bee6b932f18fadaa838cd6 /www
parent1c4d642f737365dbece72dda22d4c32097cb62e3 (diff)
disregard state transition before init is complete
Diffstat (limited to 'www')
-rw-r--r--www/js/NVR.js8
-rwxr-xr-xwww/js/app.js10
2 files changed, 16 insertions, 2 deletions
diff --git a/www/js/NVR.js b/www/js/NVR.js
index 32c605cb..c09c37f0 100644
--- a/www/js/NVR.js
+++ b/www/js/NVR.js
@@ -36,7 +36,9 @@ angular.module('zmApp.controllers')
var zmgroups = [];
var multiservers = [];
+
var migrationComplete = false;
+ $rootScope.initComplete = false; // will be true when init is fully done to take care of spurious state changes at times
var tz = "";
var isTzSupported = false;
@@ -2371,9 +2373,11 @@ angular.module('zmApp.controllers')
if (!isEmpty(loadedData)) {
loginData = loadedData;
_checkInitSanity(loginData);
- log("NVR init retrieved store loginData");
+ log("NVR init retrieved store loginData, marking init as complete");
+ $rootScope.initComplete = true;
+
} else {
- log("defaultServer configuration NOT found. Keeping login at defaults");
+ log("defaultServer configuration NOT found. Keeping login at defaults. Marking init as complete.");
}
diff --git a/www/js/app.js b/www/js/app.js
index 09365be6..95200bc8 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -1122,6 +1122,7 @@ angular.module('zmApp', [
//console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>INSIDE RUN");
NVR.log("******* app .run device ready");
+
$fileLogger.setStorageFilename(zm.logFile);
$fileLogger.setTimestampFormat('MMM d, y ' + NVR.getTimeFormatSec());
@@ -1517,6 +1518,15 @@ angular.module('zmApp', [
//----------------------------------------------------------------------------
$rootScope.$on('$stateChangeStart', function (event, toState, toParams) {
+
+
+ if (!$rootScope.initComplete) {
+ NVR.debug ("---> Init not complete, ignoring state change request to "+toState.name);
+ event.preventDefault();
+ return;
+
+ };
+
var requireLogin = toState.data.requireLogin;
$rootScope.dpadId = 0;