From b327c9d59af37ae87be4f2fb344e185d683b49a0 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 10 May 2019 11:35:43 -0400 Subject: don't use startWith to avoid Android 5.0 errors --- www/js/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'www/js') diff --git a/www/js/app.js b/www/js/app.js index cc941d9b..c5428465 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -700,7 +700,7 @@ angular.module('zmApp', [ //console.log ("HTTP response"); - if (response.data && typeof(response.data) == 'string' && response.data.startsWith("
")) {
+        if (response.data && typeof(response.data) == 'string' && (response.data.indexOf("
")==0)) {
             console.log ("cake error detected, attempting fix...");
             //console.log ("BAD = "+ JSON.stringify(response.data));
             response.data = JSON.parse(response.data.replace(/
[\s\S]*<\/pre>/,''));
@@ -1333,7 +1333,7 @@ angular.module('zmApp', [
 
             // Now go ahead and re-get auth key 
             // if login was a success
-            $rootScope.authSession = "undefined";
+            $rootScope.authSession = '';
             var ld = NVR.getLogin();
             NVR.getAuthKey($rootScope.validMonitorId)
               .then(function (success) {
@@ -2381,7 +2381,7 @@ angular.module('zmApp', [
                    // work around for cake-error leak
 
                   // console.log ("HTTP RESPONSE:" + JSON.stringify(succ.data));
-                   if (succ.data && succ.data.startsWith("
") ) {
+                   if (succ.data && (succ.data.indexOf("
") == 0) ) {
                     logger.debug ("**** Native: cake-error in message, trying fix...");
                     succ.data = JSON.parse(succ.data.replace(/
[\s\S]*<\/pre>/,''));
                   }
-- 
cgit v1.2.3