summaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-28 21:02:51 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-28 21:02:51 -0700
commit9462bc397b45aef0034f5ef8d11294125198581b (patch)
tree2fe1eb7a56037ca1cd96237a9a85161a353433ea /ext/bg/js/translator.js
parent1483dd4f09d4087bb13b270083a316f8bc64b34b (diff)
Cleanup
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index d1a92d08..f7dfae13 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -38,16 +38,16 @@ class Translator {
this.tagMeta = tagMeta;
return this.dictionary.existsDb();
}).then((exists) => {
+ this.dictionary.initDb();
if (exists) {
- return this.dictionary.loadDb();
- } else {
- this.dictionary.initDb();
- return Promise.all([
- this.dictionary.importKanjiDict('bg/data/kanjidic/index.json'),
- this.dictionary.importTermDict('bg/data/edict/index.json'),
- this.dictionary.importTermDict('bg/data/enamdict/index.json')
- ]);
+ return Promise.resolve();
}
+
+ return Promise.all([
+ this.dictionary.importKanjiDict('bg/data/kanjidic/index.json'),
+ this.dictionary.importTermDict('bg/data/edict/index.json'),
+ this.dictionary.importTermDict('bg/data/enamdict/index.json')
+ ]);
}).then(() => {
this.dictionary.findTerm('猫').then((result) => {
console.log(result);