From 7bae982c2f9b97af2b7b729d37974321b169cb22 Mon Sep 17 00:00:00 2001 From: wearrrrr Date: Mon, 14 Oct 2024 23:36:09 -0500 Subject: [PATCH] remove some redundancy --- src/worker/index.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/worker/index.ts b/src/worker/index.ts index c23cd23..3805605 100644 --- a/src/worker/index.ts +++ b/src/worker/index.ts @@ -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"); } }); }