fix: search page not resetting to 1 when query changes (#5983)
* fix: search page not resetting to 1 when query changes * prepr
This commit is contained in:
@@ -180,6 +180,26 @@ export function useBrowseSearch(options: UseBrowseSearchOptions): BrowseSearchSt
|
||||
let searchVersion = 0
|
||||
let searchDebounceTimer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
const providedFiltersOrEmpty = computed(() => options.providedFilters?.value ?? [])
|
||||
|
||||
watch(
|
||||
[
|
||||
query,
|
||||
maxResults,
|
||||
options.projectType,
|
||||
currentSortType,
|
||||
serverCurrentSortType,
|
||||
currentFilters,
|
||||
serverCurrentFilters,
|
||||
overriddenProvidedFilterTypes,
|
||||
providedFiltersOrEmpty,
|
||||
],
|
||||
() => {
|
||||
currentPage.value = 1
|
||||
},
|
||||
{ deep: true },
|
||||
)
|
||||
|
||||
watch(effectiveRequestParams, (newVal, oldVal) => {
|
||||
debug('effectiveRequestParams changed', {
|
||||
from: oldVal?.substring(0, 80),
|
||||
|
||||
Reference in New Issue
Block a user