From 0e8f00a68f625953e94112c95a952cd022f0f2af Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 5 Mar 2017 11:39:07 -0800 Subject: [PATCH] add code to enable all dictionaries if all are disabled (workaround for old options bug) --- ext/bg/js/util.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; + } + } } ];