mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
fix Storage logic
This commit is contained in:
parent
4b6261188e
commit
8a3d45dc54
1 changed files with 9 additions and 6 deletions
|
@ -8,10 +8,7 @@ const store = new IDBMapSync(locationProxy.host, {
|
|||
|
||||
await store.sync();
|
||||
|
||||
delete window.localStorage;
|
||||
delete window.sessionStorage;
|
||||
|
||||
window.localStorage = new Proxy(localStorage, {
|
||||
const localStorageProxy = new Proxy(window.localStorage, {
|
||||
get(target, prop) {
|
||||
switch (prop) {
|
||||
case "getItem":
|
||||
|
@ -65,7 +62,7 @@ window.localStorage = new Proxy(localStorage, {
|
|||
},
|
||||
});
|
||||
|
||||
window.sessionStorage = new Proxy(sessionStorage, {
|
||||
const sessionStorageProxy = new Proxy(window.sessionStorage, {
|
||||
get(target, prop) {
|
||||
switch (prop) {
|
||||
case "getItem":
|
||||
|
@ -117,3 +114,9 @@ window.sessionStorage = new Proxy(sessionStorage, {
|
|||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
delete window.localStorage;
|
||||
delete window.sessionStorage;
|
||||
|
||||
window.localStorage = localStorageProxy;
|
||||
window.sessionStorage = sessionStorageProxy;
|
Loading…
Add table
Add a link
Reference in a new issue