summaryrefslogtreecommitdiff
path: root/ext/js/pages
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages')
-rw-r--r--ext/js/pages/settings/sort-frequency-dictionary-controller.js22
1 files changed, 6 insertions, 16 deletions
diff --git a/ext/js/pages/settings/sort-frequency-dictionary-controller.js b/ext/js/pages/settings/sort-frequency-dictionary-controller.js
index a88a2d47..774c3e35 100644
--- a/ext/js/pages/settings/sort-frequency-dictionary-controller.js
+++ b/ext/js/pages/settings/sort-frequency-dictionary-controller.js
@@ -107,11 +107,12 @@ export class SortFrequencyDictionaryController {
option.textContent = 'None';
fragment.appendChild(option);
for (const {title, counts} of dictionaries) {
- if (this._dictionaryHasNoFrequencies(counts)) { continue; }
- option = document.createElement('option');
- option.value = title;
- option.textContent = title;
- fragment.appendChild(option);
+ if (counts.termMeta.freq > 0) {
+ option = document.createElement('option');
+ option.value = title;
+ option.textContent = title;
+ fragment.appendChild(option);
+ }
}
const select = /** @type {HTMLSelectElement} */ (this._sortFrequencyDictionarySelect);
select.textContent = '';
@@ -196,17 +197,6 @@ export class SortFrequencyDictionaryController {
}
/**
- * @param {import('dictionary-importer').SummaryCounts} counts
- * @returns {boolean}
- */
- _dictionaryHasNoFrequencies(counts) {
- if (typeof counts !== 'object' || counts === null) { return false; }
- const {termMeta} = counts;
- if (typeof termMeta !== 'object' || termMeta === null) { return false; }
- return termMeta.freq <= 0;
- }
-
- /**
* @param {string} value
* @returns {?import('settings').SortFrequencyDictionaryOrder}
*/