@tanstack/solid-query 4.24.9 → 4.24.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3146,11 +3146,16 @@
|
|
|
3146
3146
|
queries.forEach(dehydratedQuery => {
|
|
3147
3147
|
var _options$defaultOptio2;
|
|
3148
3148
|
|
|
3149
|
-
const query = queryCache.get(dehydratedQuery.queryHash); //
|
|
3149
|
+
const query = queryCache.get(dehydratedQuery.queryHash); // Reset fetch status to idle in the dehydrated state to avoid
|
|
3150
|
+
// query being stuck in fetching state upon hydration
|
|
3151
|
+
|
|
3152
|
+
const dehydratedQueryState = { ...dehydratedQuery.state,
|
|
3153
|
+
fetchStatus: 'idle'
|
|
3154
|
+
}; // Do not hydrate if an existing query exists with newer data
|
|
3150
3155
|
|
|
3151
3156
|
if (query) {
|
|
3152
|
-
if (query.state.dataUpdatedAt <
|
|
3153
|
-
query.setState(
|
|
3157
|
+
if (query.state.dataUpdatedAt < dehydratedQueryState.dataUpdatedAt) {
|
|
3158
|
+
query.setState(dehydratedQueryState);
|
|
3154
3159
|
}
|
|
3155
3160
|
|
|
3156
3161
|
return;
|
|
@@ -3160,7 +3165,7 @@
|
|
|
3160
3165
|
queryCache.build(client, { ...(options == null ? void 0 : (_options$defaultOptio2 = options.defaultOptions) == null ? void 0 : _options$defaultOptio2.queries),
|
|
3161
3166
|
queryKey: dehydratedQuery.queryKey,
|
|
3162
3167
|
queryHash: dehydratedQuery.queryHash
|
|
3163
|
-
},
|
|
3168
|
+
}, dehydratedQueryState);
|
|
3164
3169
|
});
|
|
3165
3170
|
}
|
|
3166
3171
|
|