summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/anki-templates.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-14 16:59:44 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-29 12:33:03 -0500
commit3033fea31e4bc9ba7198d2d31d6f6046813926d1 (patch)
tree4d6e212260ee9bca9f4807fe6d6fefbe9ed12f22 /ext/bg/js/settings/anki-templates.js
parent024f969bfd884e43cd40f408d0e3ba32839be45f (diff)
Treat null templates as the default value
Diffstat (limited to 'ext/bg/js/settings/anki-templates.js')
-rw-r--r--ext/bg/js/settings/anki-templates.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/bg/js/settings/anki-templates.js b/ext/bg/js/settings/anki-templates.js
index 9cdfc134..0e6e3cbd 100644
--- a/ext/bg/js/settings/anki-templates.js
+++ b/ext/bg/js/settings/anki-templates.js
@@ -73,7 +73,9 @@ async function ankiTemplatesValidate(infoNode, field, mode, showSuccessResult, i
const definition = await ankiTemplatesValidateGetDefinition(text, optionsContext);
if (definition !== null) {
const options = await apiOptionsGet(optionsContext);
- result = await dictFieldFormat(field, definition, mode, options, exceptions);
+ let templates = options.anki.fieldTemplates;
+ if (typeof templates !== 'string') { templates = profileOptionsGetDefaultFieldTemplates(); }
+ result = await dictFieldFormat(field, definition, mode, options, templates, exceptions);
}
} catch (e) {
exceptions.push(e);