diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-03-05 11:39:07 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-03-05 11:39:07 -0800 |
commit | 0e8f00a68f625953e94112c95a952cd022f0f2af (patch) | |
tree | 76f6c51d5af3ffe0c7979d9be80d17b4f44662bd | |
parent | 41624605f524fa424d43ab9c9ae45546d9235ba0 (diff) |
add code to enable all dictionaries if all are disabled (workaround for
old options bug)
-rw-r--r-- | ext/bg/js/util.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index 23173d3f..37fb0843 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -172,6 +172,21 @@ function optionsVersion(options) { fixupFields(options.anki.terms.fields); fixupFields(options.anki.kanji.fields); + }, + () => { + let hasEnabledDict = false; + for (const title in options.dictionaries) { + if (options.dictionaries[title].enabled) { + hasEnabledDict = true; + break; + } + } + + if (!hasEnabledDict) { + for (const title in options.dictionaries) { + options.dictionaries[title].enabled = true; + } + } } ]; |