From 42901a295d49137506a3479d5c85c3cca7772f53 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Fri, 18 Nov 2016 12:33:12 +0100 Subject: [PATCH] Pebble: pretend the clay-settings key is always present (but empty per default) in the localStorage --- .../main/assets/app_config/js/gadgetbridge_boilerplate.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/assets/app_config/js/gadgetbridge_boilerplate.js b/app/src/main/assets/app_config/js/gadgetbridge_boilerplate.js index 24de66f5..035fd08c 100644 --- a/app/src/main/assets/app_config/js/gadgetbridge_boilerplate.js +++ b/app/src/main/assets/app_config/js/gadgetbridge_boilerplate.js @@ -7,8 +7,12 @@ if (window.Storage){ }).bind(Storage.prototype.setItem); Storage.prototype.getItem = (function(key) { - //GBjs.gbLog("I am about to return " + prefix + key); - return this.call(localStorage,prefix + key); +// console.log("I am about to return " + prefix + key); + var def = null; + if(key == 'clay-settings') { + def = '{}'; + } + return this.call(localStorage,prefix + key) || def; }).bind(Storage.prototype.getItem); }