aboutsummaryrefslogtreecommitdiff
path: root/ext/js
diff options
context:
space:
mode:
authorpraschke <stel@comfy.monster>2023-10-13 13:14:56 +0100
committerpraschke <stel@comfy.monster>2023-10-13 14:33:37 +0100
commit30cbe0e1da33b8eeee480619c5720abfc3e2ecf6 (patch)
treeac96fc7576d7f483b54ccd5125dc7615bfd046fa /ext/js
parent5701cb1c832076c9f4ec9a20ba816d3fd15109ef (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.js6
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);