From b2d30e5c346c49ba4a9229975b7ba9172c0a9ade Mon Sep 17 00:00:00 2001 From: itepechi Date: Sun, 21 Apr 2024 04:59:16 +0900 Subject: [PATCH] Fixed search type prioritization issue Fixed the condition to prevent confusion between automatically selected tabs and those chosen by the user. --- src/components/search/search.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/search/search.js b/src/components/search/search.js index 84f808c0..4029245b 100644 --- a/src/components/search/search.js +++ b/src/components/search/search.js @@ -124,9 +124,11 @@ const Search = { let searchTypes = allSearchTypes if (searchType) { + // Search only for `searchType` if it is provided searchTypes = [searchType] - } else if (this.currentResultTab !== 'statuses') { - // Sort search order; selected tab first + } else if (this.hasUserSelectedTab && this.currentResultTab !== 'statuses') { + // Start the search from the tab that the user has selected + // No need to sort if userPreferredTab === 'statuses' searchTypes = [ this.currentResultTab, ...allSearchTypes.filter((tab) => tab !== this.currentResultTab)