From 479b09f62d150cd56990be3d638c6b5f9dc5587c Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 2 Nov 2017 14:56:45 -0400 Subject: bazillion changes/cleanup - I think I got the big offender it was unload handler in app.js #550 --- www/js/DataModel.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 8f702c66..12e90ab3 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -9,8 +9,8 @@ angular.module('zmApp.controllers') -.service('NVRDataModel', ['$http', '$q', '$ionicLoading', '$ionicBackdrop', '$fileLogger', 'zm', '$rootScope', '$ionicContentBanner', '$timeout', '$cordovaPinDialog', '$ionicPopup', '$localstorage', '$state', '$ionicNativeTransitions', '$translate', '$cordovaSQLite', - function($http, $q, $ionicLoading, $ionicBackdrop, $fileLogger, +.service('NVRDataModel', ['$ionicPlatform', '$http', '$q', '$ionicLoading', '$ionicBackdrop', '$fileLogger', 'zm', '$rootScope', '$ionicContentBanner', '$timeout', '$cordovaPinDialog', '$ionicPopup', '$localstorage', '$state', '$ionicNativeTransitions', '$translate', '$cordovaSQLite', + function($ionicPlatform, $http, $q, $ionicLoading, $ionicBackdrop, $fileLogger, zm, $rootScope, $ionicContentBanner, $timeout, $cordovaPinDialog, $ionicPopup, $localstorage, $state, $ionicNativeTransitions, $translate) { @@ -276,13 +276,18 @@ angular.module('zmApp.controllers') val = val.replace(regex1, ""); val = val.replace(regex2, ""); } - $fileLogger.debug(val); + + $ionicPlatform.ready(function () { + $fileLogger.debug(val); + }); //console.log (val); } } function log(val, logtype) { + + if (loginData.enableLogs) { if (val !== undefined) @@ -298,7 +303,9 @@ angular.module('zmApp.controllers') // make sure password is removed //"username":"zmninja","password":"xyz", //val = val.replace(/\"password:\", - $fileLogger.log(logtype, val); + $ionicPlatform.ready(function () { + $fileLogger.log(logtype, val); + }); // console.log (val); } } @@ -652,6 +659,9 @@ angular.module('zmApp.controllers') { // console.log("****** DATAMODEL INIT SERVICE CALLED ********"); + + + log("ZMData init: checking for stored variables & setting up log file"); localforage.getItem("latestBlogPostChecked") -- cgit v1.2.3