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:
Prospector
2026-05-03 12:02:09 -07:00
committed by GitHub
parent a4c8154438
commit c1d7aa494c

View File

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