From 94af149040679f3c6ba6d48583ec254b1fc3bbb1 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 12 Mar 2017 09:18:40 -0700 Subject: [PATCH] fix broken options on update --- ext/bg/js/util.js | 15 +++++++++++++++ ext/manifest.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index d9bd76c5..59eb9269 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -186,6 +186,21 @@ function optionsVersion(options) { } } + if (!hasEnabledDict) { + for (const title in options.dictionaries) { + options.dictionaries[title].enabled = true; + } + } + }, + () => { + 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; diff --git a/ext/manifest.json b/ext/manifest.json index 273d12d5..bb96ecc5 100644 --- a/ext/manifest.json +++ b/ext/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Yomichan", - "version": "1.1.3", + "version": "1.1.4", "description": "Japanese dictionary with Anki integration", "icons": {"16": "mixed/img/icon16.png", "48": "mixed/img/icon48.png", "128": "mixed/img/icon128.png"},