summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-30 20:51:20 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-30 20:51:20 -0400
commit9052ab8ebd5af505f1992bfc001b226202e2f393 (patch)
tree4c882f0d4e84cc2874ce534af5bf2de802cfba6d /ext/bg/js/backend.js
parent02f7763f004790a432302637586a876291e32f61 (diff)
Move dictionary import functionality into a new class
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 3ef7c62c..1e8c979f 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -25,6 +25,7 @@
* BackendApiForwarder
* ClipboardMonitor
* Database
+ * DictionaryImporter
* JsonSchema
* Mecab
* Translator
@@ -45,6 +46,7 @@
class Backend {
constructor() {
this.database = new Database();
+ this.dictionaryImporter = new DictionaryImporter();
this.translator = new Translator(this.database);
this.anki = new AnkiNull();
this.mecab = new Mecab();
@@ -300,7 +302,7 @@ class Backend {
}
async importDictionary(archiveSource, onProgress, details) {
- return await this.translator.database.importDictionary(archiveSource, onProgress, details);
+ return await this.dictionaryImporter.import(this.database, archiveSource, onProgress, details);
}
// Message handlers