aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/anki.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-26 21:01:00 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-26 21:01:19 -0500
commit2dbb24ea0416cb83185b6f92624bd9b6e937eade (patch)
tree8e613e5aa3c7c6dc45c74967533d64e0818292d4 /ext/bg/js/settings/anki.js
parent0cf1cf3aa094585bd6db8db2c1f229ba0ea37b6e (diff)
Improve error messages when Interface server is invalid
Diffstat (limited to 'ext/bg/js/settings/anki.js')
-rw-r--r--ext/bg/js/settings/anki.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/bg/js/settings/anki.js b/ext/bg/js/settings/anki.js
index 9adb2f2a..3b0912d4 100644
--- a/ext/bg/js/settings/anki.js
+++ b/ext/bg/js/settings/anki.js
@@ -35,9 +35,15 @@ function _ankiSetError(error) {
const node = document.querySelector('#anki-error');
if (!node) { return; }
if (error) {
+ const errorString = `${error}`;
node.hidden = false;
- node.textContent = `${error}`;
+ node.textContent = errorString;
_ankiSetErrorData(node, error);
+
+ const node2 = document.querySelector('#anki-invalid-response-error');
+ if (node2 !== null) {
+ node2.hidden = (errorString.indexOf('Invalid response') < 0);
+ }
} else {
node.hidden = true;
node.textContent = '';