summaryrefslogtreecommitdiff
path: root/ext/bg/js/database.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-09 20:49:44 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-09 20:52:16 -0500
commit3e864c44c379ae3c5f5c046ca2c2cd9155b6b7e0 (patch)
tree99cef3f64d56f13f46e5a6736c40164d6c988351 /ext/bg/js/database.js
parent4ac41283880fdbdf9bf0b82e255004a300d62e8b (diff)
Fixes for Edge
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r--ext/bg/js/database.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 3476b715..8317a91a 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -266,15 +266,17 @@ class Database {
]);
}
- const totalPromise = getTotal ? Database.getCounts(targets, null) : null;
+ // Query is required for Edge, otherwise index.count throws an exception.
+ const query1 = IDBKeyRange.lowerBound('', false);
+ const totalPromise = getTotal ? Database.getCounts(targets, query1) : null;
const counts = [];
const countPromises = [];
for (let i = 0; i < dictionaryNames.length; ++i) {
counts.push(null);
const index = i;
- const only = IDBKeyRange.only(dictionaryNames[i]);
- const countPromise = Database.getCounts(targets, only).then(v => counts[index] = v);
+ const query2 = IDBKeyRange.only(dictionaryNames[i]);
+ const countPromise = Database.getCounts(targets, query2).then(v => counts[index] = v);
countPromises.push(countPromise);
}
await Promise.all(countPromises);