Skip to content

Commit 878f085

Browse files
ci: apply automated fixes
1 parent 191f7b1 commit 878f085

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

packages/query-core/src/hydration.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)