Only run re-ordering when wiki not disabled
parent
3f87018ac8
commit
d7fcc1d172
|
@ -560,6 +560,8 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
|
|||
// Handle re-ordering of results to move destination results up the page
|
||||
let matchingDest = await commonFunctionFindMatchingSite(searchResultLink, crossLanguageSetting, true);
|
||||
if (matchingDest) {
|
||||
let searchEngineSettings = await commonFunctionDecompressJSON(storage.searchEngineSettings || {});
|
||||
if (searchEngineSettings[matchingDest.id] !== 'disabled') {
|
||||
if (resultsFirstChild.contains(searchResult)) {
|
||||
// If this search result is inside the first child of the results container (aka, it's the first result),
|
||||
// and there is a matchingDest at this point, then an indie wiki is #1 on the search results page.
|
||||
|
@ -571,6 +573,7 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
|
|||
reorderedHrefs.push(searchResultLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Indie Wiki Buddy failed to properly re-order search results with error: ' + e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue