remove hack and drop back to simple alert on storage block

This commit is contained in:
Stewart Allen 2020-06-13 12:15:10 -04:00
commit 1abcc6935a
2 changed files with 12 additions and 15 deletions

View file

@ -21,11 +21,7 @@
SECURE = isSecure(LOC.protocol), SECURE = isSecure(LOC.protocol),
LOCAL = self.debug && !SETUP.remote, LOCAL = self.debug && !SETUP.remote,
SDB = MOTO.KV, SDB = MOTO.KV,
PARA = SDB.getItem("__paranoid__"); ODB = KIRI.odb = new MOTO.Storage(SETUP.d ? SETUP.d[0] : 'kiri'),
if (PARA) alert(PARA);
let ODB = KIRI.odb = new MOTO.Storage(SETUP.d ? SETUP.d[0] : 'kiri'),
SPACE = KIRI.space = MOTO.Space, SPACE = KIRI.space = MOTO.Space,
WIDGETS = KIRI.widgets = [], WIDGETS = KIRI.widgets = [],
CATALOG = KIRI.catalog = KIRI.openCatalog(ODB,autoDecimate), CATALOG = KIRI.catalog = KIRI.openCatalog(ODB,autoDecimate),

View file

@ -7,16 +7,6 @@
if (!self.moto) self.moto = {}; if (!self.moto) self.moto = {};
if (self.moto.KV) return; if (self.moto.KV) return;
try {
self.moto.KV = self.localStorage;
self.moto.KV.setItem('__test', 1);
self.moto.KV.getItem('__test');
} catch (e) {
let kv = self.moto.KV = new KV();
kv.setItem("__paranoid__", "in private or restricted browsing mode. local storage blocked. application may not function.");
console.log(kv.getItem("__paranoid__"));
}
/** /**
* @param {String} dbname * @param {String} dbname
* @param {number} [version] * @param {number} [version]
@ -52,4 +42,15 @@
} }
}; };
try {
self.moto.KV = self.localStorage;
self.moto.KV.setItem('__test', 1);
self.moto.KV.getItem('__test');
} catch (e) {
self.moto.KV = new KV();
let msg = "in private or restricted browsing mode. local storage blocked. application may not function.";
console.log(msg);
alert(msg);
}
})(); })();