Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/query-core/src/hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export function hydrate(
...(state.status === 'pending' &&
data !== undefined && {
status: 'success' as const,
dataUpdatedAt: dehydratedAt ?? Date.now(),
// Preserve existing fetchStatus if the existing query is actively fetching.
...(!existingQueryIsFetching && {
fetchStatus: 'idle' as const,
Expand Down Expand Up @@ -284,6 +285,10 @@ export function hydrate(
state.status === 'pending' && data !== undefined
? 'success'
: state.status,
...(state.status === 'pending' &&
data !== undefined && {
dataUpdatedAt: dehydratedAt ?? Date.now(),
}),
},
)
}
Expand Down
Loading