@ciwergrp/nuxid 1.17.7 → 1.17.8
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.
package/dist/module.json
CHANGED
|
@@ -87,7 +87,8 @@ export async function useCursorHttp(url, options) {
|
|
|
87
87
|
return String(url);
|
|
88
88
|
}
|
|
89
89
|
})());
|
|
90
|
-
const { useState } = await import("#app");
|
|
90
|
+
const { useNuxtApp, useState } = await import("#app");
|
|
91
|
+
const nuxtApp = useNuxtApp();
|
|
91
92
|
const initialResponseState = useState(stateKey, () => null);
|
|
92
93
|
let pollTimer = null;
|
|
93
94
|
let fetchPromise = null;
|
|
@@ -165,7 +166,8 @@ export async function useCursorHttp(url, options) {
|
|
|
165
166
|
if (loading.value) {
|
|
166
167
|
return fetchPromise ?? Promise.resolve();
|
|
167
168
|
}
|
|
168
|
-
|
|
169
|
+
const canUseHydrationCache = import.meta.client && nuxtApp.isHydrating && nuxtApp.payload.serverRendered;
|
|
170
|
+
if (useCache && canUseHydrationCache && initialResponseState.value) {
|
|
169
171
|
applyResponse(initialResponseState.value);
|
|
170
172
|
return Promise.resolve();
|
|
171
173
|
}
|