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:39:04 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-30 20:39:04 -0400
commitc193a703cc1444fbc75e62954ca3a10210ad95d0 (patch)
treec34f80b71f058cc256795ea52df7972bb8766290 /ext/bg/js/backend.js
parent8095d9138c413f27b26c9ccba2ca2ae9762707f3 (diff)
Move database creation into Backend
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index b217e64d..dd666b0d 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -24,6 +24,7 @@
* AudioUriBuilder
* BackendApiForwarder
* ClipboardMonitor
+ * Database
* JsonSchema
* Mecab
* Translator
@@ -43,7 +44,8 @@
class Backend {
constructor() {
- this.translator = new Translator();
+ this.database = new Database();
+ this.translator = new Translator(this.database);
this.anki = new AnkiNull();
this.mecab = new Mecab();
this.clipboardMonitor = new ClipboardMonitor({getClipboard: this._onApiClipboardGet.bind(this)});
@@ -107,6 +109,7 @@ class Backend {
}
async prepare() {
+ await this.database.prepare();
await this.translator.prepare();
this.optionsSchema = await requestJson(chrome.runtime.getURL('/bg/data/options-schema.json'), 'GET');