diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-12 12:38:33 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-12 12:38:33 -0400 |
commit | 4c2ca82a2937fa4e1d0f3f6744f4e1a7b88692a1 (patch) | |
tree | c28c2d52e6c888800e6252fcb68438d590de7cbf /ext/bg/js/backend.js | |
parent | c41c7252aeb5f10fca7403a19740d869743a38a5 (diff) |
Use single instance of AnkiConnect
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r-- | ext/bg/js/backend.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index be8ea322..24a16199 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -47,7 +47,7 @@ class Backend { this.database = new Database(); this.dictionaryImporter = new DictionaryImporter(); this.translator = new Translator(this.database); - this.anki = new AnkiNull(); + this.anki = new AnkiConnect(); this.mecab = new Mecab(); this.clipboardMonitor = new ClipboardMonitor({getClipboard: this._onApiClipboardGet.bind(this)}); this.options = null; @@ -210,7 +210,8 @@ class Backend { this.setExtensionBadgeText(''); } - this.anki = options.anki.enable ? new AnkiConnect(options.anki.server) : new AnkiNull(); + this.anki.setServer(options.anki.server); + this.anki.setEnabled(options.anki.enable); if (options.parsing.enableMecabParser) { this.mecab.startListener(); |