@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ciwergrp/nuxid",
3
3
  "configKey": "nuxid",
4
- "version": "1.17.7",
4
+ "version": "1.17.8",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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
- if (useCache && initialResponseState.value) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciwergrp/nuxid",
3
- "version": "1.17.7",
3
+ "version": "1.17.8",
4
4
  "description": "All-in-one essential modules for Nuxt",
5
5
  "repository": {
6
6
  "type": "git",