@burdenoff/website-sdk 2026.817.2 → 2026.824.1
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/components/partners.js.map +1 -1
- package/dist/components/partners.mjs.map +1 -1
- package/dist/content/index.js +25 -3
- package/dist/content/index.js.map +1 -1
- package/dist/content/index.mjs +25 -3
- package/dist/content/index.mjs.map +1 -1
- package/dist/index.js +77 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/content/index.js
CHANGED
|
@@ -354,16 +354,38 @@ var PUBLIC_CONTENT_PAGES_QUERY = `
|
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
`;
|
|
357
|
+
function resolveContentPageGate(resolvedProductId, hasProvider, productLoading) {
|
|
358
|
+
if (resolvedProductId) return "fetch";
|
|
359
|
+
return hasProvider && productLoading ? "wait" : "unavailable";
|
|
360
|
+
}
|
|
357
361
|
function useContentPage(slug, options) {
|
|
358
362
|
const client = useWebSDK();
|
|
359
363
|
const config = useWebSDKConfig();
|
|
360
|
-
const {
|
|
364
|
+
const {
|
|
365
|
+
product,
|
|
366
|
+
loading: productLoading,
|
|
367
|
+
error: productError,
|
|
368
|
+
hasProvider
|
|
369
|
+
} = useProduct();
|
|
361
370
|
const resolvedProductId = product?.id || config.productId;
|
|
371
|
+
const gate = resolveContentPageGate(
|
|
372
|
+
resolvedProductId,
|
|
373
|
+
hasProvider,
|
|
374
|
+
productLoading
|
|
375
|
+
);
|
|
362
376
|
const [data, setData] = React.useState(null);
|
|
363
377
|
const [loading, setLoading] = React.useState(true);
|
|
364
378
|
const [error, setError] = React.useState(null);
|
|
365
379
|
const fetchPage = React.useCallback(async () => {
|
|
366
|
-
if (
|
|
380
|
+
if (gate === "wait") return;
|
|
381
|
+
if (gate === "unavailable") {
|
|
382
|
+
setData(null);
|
|
383
|
+
setError(
|
|
384
|
+
productError ?? "Product unavailable \u2014 cannot load content page"
|
|
385
|
+
);
|
|
386
|
+
setLoading(false);
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
367
389
|
setLoading(true);
|
|
368
390
|
setError(null);
|
|
369
391
|
try {
|
|
@@ -388,7 +410,7 @@ function useContentPage(slug, options) {
|
|
|
388
410
|
} finally {
|
|
389
411
|
setLoading(false);
|
|
390
412
|
}
|
|
391
|
-
}, [client, resolvedProductId, slug, options?.resolve]);
|
|
413
|
+
}, [client, gate, productError, resolvedProductId, slug, options?.resolve]);
|
|
392
414
|
React.useEffect(() => {
|
|
393
415
|
fetchPage();
|
|
394
416
|
}, [fetchPage]);
|