aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/anki-templates.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/settings/anki-templates.js')
-rw-r--r--ext/bg/js/settings/anki-templates.js20
1 files changed, 6 insertions, 14 deletions
diff --git a/ext/bg/js/settings/anki-templates.js b/ext/bg/js/settings/anki-templates.js
index 6ba20040..9cdfc134 100644
--- a/ext/bg/js/settings/anki-templates.js
+++ b/ext/bg/js/settings/anki-templates.js
@@ -22,22 +22,14 @@ function onAnkiFieldTemplatesReset(e) {
$('#field-template-reset-modal').modal('show');
}
-async function onAnkiFieldTemplatesResetConfirm(e) {
- try {
- e.preventDefault();
+function onAnkiFieldTemplatesResetConfirm(e) {
+ e.preventDefault();
- $('#field-template-reset-modal').modal('hide');
+ $('#field-template-reset-modal').modal('hide');
- const optionsContext = getOptionsContext();
- const options = await apiOptionsGet(optionsContext);
- const fieldTemplates = profileOptionsGetDefaultFieldTemplates();
- options.anki.fieldTemplates = fieldTemplates;
- $('#field-templates').val(fieldTemplates);
- onAnkiTemplatesValidateCompile();
- await settingsSaveOptions();
- } catch (error) {
- ankiErrorShow(error);
- }
+ const element = document.querySelector('#field-templates');
+ element.value = profileOptionsGetDefaultFieldTemplates();
+ element.dispatchEvent(new Event('change'));
}
function ankiTemplatesInitialize() {