summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-08-15 20:58:50 -0700
committerAlex Yatskov <alex@foosoft.net>2017-08-15 20:58:50 -0700
commite079e5f252ee39b222f3eb78e81d0a6bab6626d2 (patch)
treebdeb7f799b0282ff05bb99f7d96beb49bfd974b5 /ext
parent5c353f41e58e530d77bf17fb0e22a655feca3dbc (diff)
fix loss of anki settings
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/settings.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index 89b1581f..7bdd9f84 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -96,9 +96,6 @@ async function onFormOptionsChanged(e) {
return;
}
- ankiErrorShow();
- ankiSpinnerShow(true);
-
const {optionsNew, optionsOld} = await formRead();
await optionsSave(optionsNew);
@@ -109,7 +106,9 @@ async function onFormOptionsChanged(e) {
optionsNew.anki.server !== optionsOld.anki.server;
if (ankiUpdated) {
+ ankiSpinnerShow(true);
await ankiDeckAndModelPopulate(optionsNew);
+ ankiErrorShow();
}
} catch (e) {
ankiErrorShow(e);
@@ -414,9 +413,6 @@ async function onAnkiModelChanged(e) {
return;
}
- ankiErrorShow();
- ankiSpinnerShow(true);
-
const element = $(this);
const tab = element.closest('.tab-pane');
const tabId = tab.attr('id');
@@ -425,7 +421,9 @@ async function onAnkiModelChanged(e) {
optionsNew.anki[tabId].fields = {};
await optionsSave(optionsNew);
+ ankiSpinnerShow(true);
await ankiFieldsPopulate(element, optionsNew);
+ ankiErrorShow();
} catch (e) {
ankiErrorShow(e);
} finally {