summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-12-09 06:24:02 -0500
committerPliable Pixels <pliablepixels@gmail.com>2018-12-09 06:24:02 -0500
commit258f6666b0e268689356454731e27973d8363c47 (patch)
treeb64fa2fda9cb7c80d2b320ae70b0225ba2dc0a8a
parentcd9c8af8281f20e4a08828556d1a1d39a8e35c2c (diff)
use last saved state for mobile too as it now quits
-rw-r--r--package.json4
-rwxr-xr-xwww/js/app.js32
2 files changed, 6 insertions, 30 deletions
diff --git a/package.json b/package.json
index 0e110fff..592fc815 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "zmninjapro",
"description": "Home security mobile app for ZoneMinder",
- "version": "1.3.035",
+ "version":"1.3.035",
"displayName": "zmNinja",
"author": "Pliable Pixels",
"license": "custom see LICENSE.md",
@@ -176,4 +176,4 @@
]
}
}
-} \ No newline at end of file
+}
diff --git a/www/js/app.js b/www/js/app.js
index 9ca20c8e..176b5030 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -1534,33 +1534,7 @@ angular.module('zmApp', [
NVRDataModel.debug(msg);
};
- if ($rootScope.platformOS == 'desktop' && 0) {
-
- window.addEventListener('beforeunload', function (ev) {
-
- // I don't think this works on windows
- // the callback is not called, it seems
-
- // This was causing android reload issues - holy palooza
- /* if ($rootScope.platformOS != 'desktop') {
- ev.returnValue = "true";
- return;
- }*/
-
- localforage.setItem('last-desktop-state', {
- 'name': $ionicHistory.currentView().stateName,
- 'params': $ionicHistory.currentView().stateParams
- }).then(function () {
- return localforage.getItem('last-desktop-state');
- }).then(function (value) {
- ev.returnValue = "true";
- }).catch(function (err) {
- ev.returnValue = "true";
- });
-
- });
- }
-
+
// DPAD Handler - disabled for now
// when ready add ionic cordova plugin add https://github.com/pliablepixels/cordova-plugin-android-tv.git
@@ -2101,7 +2075,9 @@ angular.module('zmApp', [
function continueRestOfInit() {
- if ($rootScope.platformOS == 'desktop') {
+ // use desktop state for mobile too as
+ // mobile now quits
+ if ($rootScope.platformOS == 'desktop' || 1) {
$rootScope.lastState = "";
$rootScope.lastStateParam = {};