Compare commits

...

2 Commits

Author SHA1 Message Date
itepechi 76b44d3a39
Fixed "Load more" functionality on search page
The previous implementation caused the "Load more" button not to load
additional search results when changes were made to the input field
2024-04-21 05:49:22 +09:00
itepechi b2d30e5c34
Fixed search type prioritization issue
Fixed the condition to prevent confusion between automatically selected
tabs and those chosen by the user.
2024-04-21 04:59:16 +09:00
2 changed files with 6 additions and 4 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)

View File

@ -75,7 +75,7 @@
<button
v-if="!loading['statuses'] && loadedInitially && lastStatusFetchCount > 0"
class="more-statuses-button button-unstyled -link -fullwidth"
@click.prevent="search(searchTerm, 'statuses')"
@click.prevent="search(lastQuery, 'statuses')"
>
<div class="new-status-notification text-center">
{{ $t('search.load_more') }}
@ -114,7 +114,7 @@
<button
v-if="!loading['media'] && loadedInitially && lastMediaFetchCount > 0"
class="more-statuses-button button-unstyled -link -fullwidth"
@click.prevent="search(searchTerm, 'media')"
@click.prevent="search(lastQuery, 'media')"
>
<div class="new-status-notification text-center">
{{ $t('search.load_more') }}