Load promises on startup, correct promise store key
This commit is contained in:
parent
e3d2d58950
commit
e9d65e6495
@ -84,6 +84,7 @@ function checkPersist() {
|
||||
g_persist.forEach((v) => {
|
||||
v.put('foo');
|
||||
});
|
||||
scanPromises();
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ async function putPromise(o) {
|
||||
h.update(v);
|
||||
const z = h.getHash("HEX");
|
||||
g_persistIndex.push(z);
|
||||
localStorage.setItem('persist', JSON.stringify(g_persistIndex));
|
||||
localStorage.setItem(PERSIST_STORAGEKEY, JSON.stringify(g_persistIndex));
|
||||
for (let i = 0; i < g_persist.length; i++) {
|
||||
const o = g_persist[i];
|
||||
const r = await o.put(v);
|
||||
@ -15,7 +15,10 @@ async function putPromise(o) {
|
||||
}
|
||||
|
||||
async function scanPromises() {
|
||||
const promises = localStorage.getItem('persist');
|
||||
const promises = localStorage.getItem(PERSIST_STORAGEKEY);
|
||||
if (!promises) {
|
||||
return;
|
||||
}
|
||||
const o = JSON.parse(promises);
|
||||
const eList = document.createElement('ul');
|
||||
eList.setAttribute('id', 'promiseList');
|
||||
|
Loading…
Reference in New Issue
Block a user