From 807dd17ad6434324d952fd1a7f9d842065ab2173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Thu, 19 Oct 2023 10:02:32 +0800 Subject: [PATCH] DEBUG store --- src/indexeddb.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/indexeddb.js b/src/indexeddb.js index 10bc5d2..cffb6de 100644 --- a/src/indexeddb.js +++ b/src/indexeddb.js @@ -26,10 +26,11 @@ export default class IndexedDB { } async store(name) { - if (!this.db) return await this.open(name) + if (!this.db) await this.open(name) return new Promise((resolve, reject) => { - const request = this.db.transaction([name], 'readwrite').objectStore(name) - resolve(request) + const transaction = this.db.transaction([name], 'readwrite') + const objectStore = transaction.objectStore(name) + resolve(objectStore) }) }