properly merge old changes

This commit is contained in:
Toshit Chawda 2024-07-13 11:52:10 -07:00
parent 80abf239b4
commit 5122438c96
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D

View file

@ -1,7 +1,12 @@
import IDBMapSync from "@webreflection/idb-map/sync";
const store = new IDBMapSync(window.__location.host, {
prefix: "Storage",
durability: "relaxed"
});
await store.sync();
function storageProxy(scope: Storage): Storage {
const store = new IDBMapSync(window.__location.host);
return new Proxy(scope, {
get(target, prop) {
@ -46,7 +51,7 @@ function storageProxy(scope: Storage): Storage {
},
defineProperty(target, property, attributes) {
target.setItem(property as string, attributes.value);
store.set(property as string, attributes.value);
return true;
},