summaryrefslogtreecommitdiff
path: root/ext/js/pages/action-popup-main.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages/action-popup-main.js')
-rw-r--r--ext/js/pages/action-popup-main.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/js/pages/action-popup-main.js b/ext/js/pages/action-popup-main.js
index 2f18e028..2de986da 100644
--- a/ext/js/pages/action-popup-main.js
+++ b/ext/js/pages/action-popup-main.js
@@ -191,12 +191,16 @@ class DisplayController {
const noDictionariesEnabledWarnings = document.querySelectorAll('.no-dictionaries-enabled-warning');
const dictionaries = await yomichan.api.getDictionaryInfo();
+ const enabledDictionaries = new Set();
+ for (const {name, enabled} of options.dictionaries) {
+ if (enabled) {
+ enabledDictionaries.add(name);
+ }
+ }
+
let enabledCount = 0;
for (const {title} of dictionaries) {
- if (
- Object.prototype.hasOwnProperty.call(options.dictionaries, title) &&
- options.dictionaries[title].enabled
- ) {
+ if (enabledDictionaries.has(title)) {
++enabledCount;
}
}