For search re-ordering, reverse at end

This avoids conflicting with the check for the first result being an indie wiki
pull/662/head
Kevin Payravi 2024-05-01 14:49:05 -05:00
parent 0d4ae31f17
commit f55cd3b795
1 changed files with 1 additions and 5 deletions

View File

@ -549,10 +549,6 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
let crossLanguageSetting = storage.crossLanguage || 'off';
// Re-order search results
// This is so that higher results are re-ordered to the top last
searchResults = searchResults.reverse();
for (const searchResult of searchResults) {
try {
if (searchResult.closest('.iwb-detected')) {
@ -584,7 +580,7 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
}
}
return reorderedHrefs;
return reorderedHrefs.reverse();
}
async function filterSearchResults(searchResults, searchEngine, storage, reorderedHrefs = []) {