diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-02-01 11:42:27 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-02-01 21:00:43 -0500 |
commit | 8eaa0334acf4f36a05fa881571019532e325f4a6 (patch) | |
tree | 8706afe6b3b10de0d0700e880397db2a4d00196c /ext/bg/js/settings | |
parent | 55047def9dad485b4ad6e118c5d9eaed5d09af0c (diff) |
Remove option for dictionaries that aren't installed after changing values
Diffstat (limited to 'ext/bg/js/settings')
-rw-r--r-- | ext/bg/js/settings/dictionaries.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/bg/js/settings/dictionaries.js b/ext/bg/js/settings/dictionaries.js index 221f5b13..2355f807 100644 --- a/ext/bg/js/settings/dictionaries.js +++ b/ext/bg/js/settings/dictionaries.js @@ -445,7 +445,14 @@ async function updateMainDictionarySelectValue() { } async function onDictionaryMainChanged(e) { - const value = e.target.value; + const select = e.target; + const value = select.value; + + const missingNodeOption = select.querySelector('option[data-not-installed=true]'); + if (missingNodeOption !== null && missingNodeOption.value !== value) { + missingNodeOption.parentNode.removeChild(missingNodeOption); + } + const optionsContext = getOptionsContext(); const options = await getOptionsMutable(optionsContext); options.general.mainDictionary = value; |