mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 23:50:02 -04:00
properly merge old changes
This commit is contained in:
parent
80abf239b4
commit
5122438c96
1 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,12 @@
|
||||||
import IDBMapSync from "@webreflection/idb-map/sync";
|
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 {
|
function storageProxy(scope: Storage): Storage {
|
||||||
const store = new IDBMapSync(window.__location.host);
|
|
||||||
|
|
||||||
return new Proxy(scope, {
|
return new Proxy(scope, {
|
||||||
get(target, prop) {
|
get(target, prop) {
|
||||||
|
@ -46,7 +51,7 @@ function storageProxy(scope: Storage): Storage {
|
||||||
},
|
},
|
||||||
|
|
||||||
defineProperty(target, property, attributes) {
|
defineProperty(target, property, attributes) {
|
||||||
target.setItem(property as string, attributes.value);
|
store.set(property as string, attributes.value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue