summaryrefslogtreecommitdiff
path: root/ext/bg/js/dictionary.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-07 08:21:49 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-07 08:21:49 -0800
commit8c22f53f3e770840316b3fd2e840ffe06771a8d4 (patch)
treed1a120beb78ba7cc29a6dfa99c80d250d74095be /ext/bg/js/dictionary.js
parented2091ae1b4976b90d29f5e84efdcd41227f66b0 (diff)
Dexie fixes
Diffstat (limited to 'ext/bg/js/dictionary.js')
-rw-r--r--ext/bg/js/dictionary.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js
index f3de36f4..7a95561c 100644
--- a/ext/bg/js/dictionary.js
+++ b/ext/bg/js/dictionary.js
@@ -20,7 +20,7 @@
class Dictionary {
constructor() {
this.db = null;
- this.dbVer = 5;
+ this.dbVer = 6;
this.entities = null;
}
@@ -144,13 +144,11 @@ class Dictionary {
return Promise.reject('database not initialized');
}
- const tasks = [
- this.db.terms.where('dictionary').equals(title).delete(),
- this.db.kanji.where('dictionary').equals(title).delete(),
- this.db.entities.where('dictionary').equals(title).delete()
- ];
-
- return Promise.all(tasks).then(() => {
+ return this.db.terms.where('dictionary').equals(title).delete().then(() => {
+ return this.db.kanji.where('dictionary').equals(title).delete();
+ }).then(() => {
+ return this.db.entities.where('dictionary').equals(title).delete();
+ }).then(() => {
return this.db.dictionaries.where('title').equals(title).delete();
});
}