File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,13 +240,14 @@ export function hydrate(
240240 //
241241 // Since you can opt into dehydrating failed queries, and those can have data from
242242 // previous successful fetches, we make sure we only do this for pending queries.
243- ...( state . status === 'pending' && data !== undefined && {
244- status : 'success' as const ,
245- // Preserve existing fetchStatus if the existing query is actively fetching.
246- ...( ! existingQueryIsFetching && {
247- fetchStatus : 'idle' as const ,
243+ ...( state . status === 'pending' &&
244+ data !== undefined && {
245+ status : 'success' as const ,
246+ // Preserve existing fetchStatus if the existing query is actively fetching.
247+ ...( ! existingQueryIsFetching && {
248+ fetchStatus : 'idle' as const ,
249+ } ) ,
248250 } ) ,
249- } ) ,
250251 } )
251252 }
252253 } else {
@@ -268,7 +269,10 @@ export function hydrate(
268269 fetchStatus : 'idle' ,
269270 // Like above, if the query was pending at the moment of dehydration but has data,
270271 // we can assume it should be hydrated as successful.
271- status : state . status === 'pending' && data !== undefined ? 'success' : state . status ,
272+ status :
273+ state . status === 'pending' && data !== undefined
274+ ? 'success'
275+ : state . status ,
272276 } ,
273277 )
274278 }
You can’t perform that action at this time.
0 commit comments