mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 07:20:02 -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") {
|
||||
await this.cookieStore.setCookies([data.cookie], new URL(data.url));
|
||||
const db = indexedDB.open("$scramjet", 1);
|
||||
db.onsuccess = () => {
|
||||
const res = db.result;
|
||||
const tx = res.transaction("cookies", "readwrite");
|
||||
const store = tx.objectStore("cookies");
|
||||
store.put(this.cookieStore.dump(), "cookies");
|
||||
};
|
||||
const res = db.result;
|
||||
const tx = res.transaction("cookies", "readwrite");
|
||||
const store = tx.objectStore("cookies");
|
||||
store.put(this.cookieStore.dump(), "cookies");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue