From 30cbe0e1da33b8eeee480619c5720abfc3e2ecf6 Mon Sep 17 00:00:00 2001 From: praschke Date: Fri, 13 Oct 2023 13:14:56 +0100 Subject: [PATCH] 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 --- ext/js/language/translator.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js index edb38bfb54..3b47cc5199 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);