mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 15:30:00 -04:00
remove some redundancy
This commit is contained in:
parent
693e0644c7
commit
7bae982c2f
1 changed files with 4 additions and 7 deletions
|
@ -46,13 +46,10 @@ export class ScramjetServiceWorker extends EventTarget {
|
||||||
|
|
||||||
if (data.scramjet$type === "cookie") {
|
if (data.scramjet$type === "cookie") {
|
||||||
await this.cookieStore.setCookies([data.cookie], new URL(data.url));
|
await this.cookieStore.setCookies([data.cookie], new URL(data.url));
|
||||||
const db = indexedDB.open("$scramjet", 1);
|
const res = db.result;
|
||||||
db.onsuccess = () => {
|
const tx = res.transaction("cookies", "readwrite");
|
||||||
const res = db.result;
|
const store = tx.objectStore("cookies");
|
||||||
const tx = res.transaction("cookies", "readwrite");
|
store.put(this.cookieStore.dump(), "cookies");
|
||||||
const store = tx.objectStore("cookies");
|
|
||||||
store.put(this.cookieStore.dump(), "cookies");
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue