diff options
author | praschke <stel@comfy.monster> | 2023-10-13 13:14:56 +0100 |
---|---|---|
committer | praschke <stel@comfy.monster> | 2023-10-13 14:33:37 +0100 |
commit | 30cbe0e1da33b8eeee480619c5720abfc3e2ecf6 (patch) | |
tree | ac96fc7576d7f483b54ccd5125dc7615bfd046fa /ext/js | |
parent | 5701cb1c832076c9f4ec9a20ba816d3fd15109ef (diff) |
add sort dictionary data to parse results on the search page
this is based on forsakeninfinity's commit https://github.com/forsakeninfinity/yomibaba/commit/c9887d51ed5c917bb900d7964614154de1d76872
Diffstat (limited to 'ext/js')
-rw-r--r-- | ext/js/language/translator.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js index edb38bfb..3b47cc51 100644 --- a/ext/js/language/translator.js +++ b/ext/js/language/translator.js @@ -93,6 +93,12 @@ class Translator { } if (mode === 'simple') { + if (sortFrequencyDictionary !== null) { + const sortDictionaryMap = [sortFrequencyDictionary] + .filter((key) => enabledDictionaryMap.has(key)) + .reduce((subMap, key) => subMap.set(key, enabledDictionaryMap.get(key)), new Map()); + await this._addTermMeta(dictionaryEntries, sortDictionaryMap); + } this._clearTermTags(dictionaryEntries); } else { await this._addTermMeta(dictionaryEntries, enabledDictionaryMap); |