diff options
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/database.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js index 95466e73..9f477b24 100644 --- a/ext/bg/js/database.js +++ b/ext/bg/js/database.js @@ -182,7 +182,12 @@ class Database { this.validate(); let result = null; - await this.db.tagMeta.where('name').equals(name).each(row => { + const db = this.db.backendDB(); + const dbTransaction = db.transaction(['tagMeta'], 'readonly'); + const dbTerms = dbTransaction.objectStore('tagMeta'); + const dbIndex = dbTerms.index('name'); + const only = IDBKeyRange.only(name); + await Database.getAll(dbIndex, only, null, row => { if (title === row.dictionary) { result = row; } |