diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-14 16:59:44 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-29 12:33:03 -0500 |
commit | 3033fea31e4bc9ba7198d2d31d6f6046813926d1 (patch) | |
tree | 4d6e212260ee9bca9f4807fe6d6fefbe9ed12f22 /ext/bg/js/settings/main.js | |
parent | 024f969bfd884e43cd40f408d0e3ba32839be45f (diff) |
Treat null templates as the default value
Diffstat (limited to 'ext/bg/js/settings/main.js')
-rw-r--r-- | ext/bg/js/settings/main.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js index 870769e5..c0b2deb6 100644 --- a/ext/bg/js/settings/main.js +++ b/ext/bg/js/settings/main.js @@ -145,7 +145,11 @@ async function formWrite(options) { $('#interface-server').val(options.anki.server); $('#screenshot-format').val(options.anki.screenshot.format); $('#screenshot-quality').val(options.anki.screenshot.quality); - $('#field-templates').val(options.anki.fieldTemplates); + + let templates = options.anki.fieldTemplates; + if (typeof templates !== 'string') { templates = profileOptionsGetDefaultFieldTemplates(); } + + $('#field-templates').val(templates); onAnkiTemplatesValidateCompile(); await onAnkiOptionsChanged(options); @@ -166,7 +170,9 @@ function formUpdateVisibility(options) { if (options.general.debugInfo) { const temp = utilIsolate(options); - temp.anki.fieldTemplates = '...'; + if (typeof temp.anki.fieldTemplates === 'string') { + temp.anki.fieldTemplates = '...'; + } const text = JSON.stringify(temp, null, 4); $('#debug').text(text); } |