From 2dbb24ea0416cb83185b6f92624bd9b6e937eade Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 26 Jan 2020 21:01:00 -0500 Subject: Improve error messages when Interface server is invalid --- ext/bg/js/settings/anki.js | 8 +++++++- ext/bg/settings.html | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'ext') 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 = ''; diff --git a/ext/bg/settings.html b/ext/bg/settings.html index 3e06d4b5..8c787aff 100644 --- a/ext/bg/settings.html +++ b/ext/bg/settings.html @@ -760,6 +760,13 @@ + +
@@ -771,7 +778,7 @@
- +
-- cgit v1.2.3