summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-06-29 10:00:35 -0400
committerPliable Pixels <pliablepixels@gmail.com>2018-06-29 10:00:35 -0400
commit29d31be0a4deca1030cc73260af7ef5e1f983d80 (patch)
tree77f279b83f39f313441bce7e61af8f5a40d53c12
parent0a349f2ccbe2ffdcfa54c73e4c44503ed6822a4c (diff)
#647 - fixed rootscope->rootScope, added fallback to window stop after 5 sec, if exitApp did not work, removed redundant multiport exit app
-rwxr-xr-xwww/js/app.js28
1 files changed, 20 insertions, 8 deletions
diff --git a/www/js/app.js b/www/js/app.js
index 516b11a1..4548e47a 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -1880,6 +1880,7 @@ angular.module('zmApp', [
//----------------------------------------------------------------------------
document.addEventListener("resume", function () {
+ NVRDataModel.setBackground(false);
NVRDataModel.setJustResumed(true);
$ionicPlatform.ready(function () {
NVRDataModel.log("App is resuming from background");
@@ -1887,7 +1888,7 @@ angular.module('zmApp', [
var ld = NVRDataModel.getLogin();
- NVRDataModel.setBackground(false);
+
// don't animate
$ionicHistory.nextViewOptions({
disableAnimate: true,
@@ -1954,21 +1955,32 @@ angular.module('zmApp', [
var ld = NVRDataModel.getLogin();
- if ($rootscope.platformOS == "android") {
- NVRDataModel.log("force exiting app since its android");
- navigator.app.exitApp();
+ if ($rootScope.platformOS == "android") {
+ NVRDataModel.log(" force exiting app since its android");
+ //navigator.app.exitApp();
+ $timeout (function () {
+ if (NVRDataModel.isBackground()) {
+ NVRDataModel.log ("If this shows up, then the app did not exit...");
+ window.stop();
+ }
+ else {
+ NVRDataModel.log ("window stop delay timeout called as part of pause, but app no longer in background");
+ }
+
+
+ },5000);
}
- if (ld.exitOnSleep && $rootScope.platformOS == "android") {
+ /* if (ld.exitOnSleep && $rootScope.platformOS == "android") {
NVRDataModel.log("user exited app");
navigator.app.exitApp();
// ionic.Platform.exitApp();
- }
+ }*/
- if (NVRDataModel.getCurrentServerMultiPortSupported() && $rootScope.platformOS == "android" && !NVRDataModel.isMultiPortDisabled()) {
+ /* if (NVRDataModel.getCurrentServerMultiPortSupported() && $rootScope.platformOS == "android" && !NVRDataModel.isMultiPortDisabled()) {
NVRDataModel.log ("Multiport is active, killing app to make sure no streams continue in background...");
navigator.app.exitApp();
} else {
@@ -1977,7 +1989,7 @@ angular.module('zmApp', [
NVRDataModel.debug ("platform:"+$rootScope.platformOS);
NVRDataModel.debug ("isMultiPortDisabled:"+NVRDataModel.isMultiPortDisabled());
- }
+ }*/
if ($rootScope.zmPopup)
$rootScope.zmPopup.close();