Fixed search type prioritization issue

Fixed the condition to prevent confusion between automatically selected
tabs and those chosen by the user.
This commit is contained in:
itepechi 2024-04-21 04:59:16 +09:00
parent 60d0c91eb9
commit b2d30e5c34
Signed by: itepechi
GPG Key ID: D948CE1B5ACD0B25
1 changed files with 4 additions and 2 deletions

View File

@ -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)