aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-05-30 12:03:24 -0400
committerGitHub <noreply@github.com>2022-05-30 12:03:24 -0400
commit19bba07a8bccb51a9db85c13fd921d825defe753 (patch)
tree4354e2d3396f5957a005256a85f60d239ab30c0d /ext/js/background/backend.js
parent0b5d54e7c66c17383e23855a1c3d4dbb1ea817fc (diff)
Add support for Anki API key (#2169)
* Update material.css to support password fields * Support password * Add "apiKey" setting * Use apiKey * Update options if API key changes * Update tests
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index 07d6fd98..75ff7bee 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -998,8 +998,11 @@ class Backend {
const enabled = options.general.enable;
+ let {apiKey} = options.anki;
+ if (apiKey === '') { apiKey = null; }
this._anki.server = options.anki.server;
this._anki.enabled = options.anki.enable && enabled;
+ this._anki.apiKey = apiKey;
this._mecab.setEnabled(options.parsing.enableMecabParser && enabled);