fix(history): isolate query scope transitions

This commit is contained in:
lingniu
2026-07-16 04:36:41 +08:00
parent 6b4a0726b2
commit d95d7ab735
6 changed files with 131 additions and 10 deletions

View File

@@ -3,3 +3,7 @@ export const QUERY_MEMORY = {
optionGcTime: 30_000,
summaryGcTime: 60_000
} as const;
export function retainPreviousPageWithinScope<T>(scope: string) {
return (previous: T | undefined, previousQuery?: { queryKey: readonly unknown[] }) => previousQuery?.queryKey[1] === scope ? previous : undefined;
}