@funnelsgrove/runtime 0.7.26 → 0.7.27
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.
|
@@ -13,6 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { createContext, useContext, useEffect, useMemo, useState, } from 'react';
|
|
15
15
|
import { loadFunnelRuntimeConfig, resolvePublishedFunnelRuntimeConfig, } from '../services/funnel-runtime-config.js';
|
|
16
|
+
import { isPreviewFrameRuntime } from '../services/preview-frame.service.js';
|
|
16
17
|
const FunnelRuntimeConfigContext = createContext({
|
|
17
18
|
status: 'fallback',
|
|
18
19
|
config: null,
|
|
@@ -32,6 +33,12 @@ function ActiveFunnelRuntimeConfigBoundary({ funnelId, funnelVersionId, children
|
|
|
32
33
|
error: null,
|
|
33
34
|
});
|
|
34
35
|
useEffect(() => {
|
|
36
|
+
// The server snapshot cannot see the browser query string, so a preview
|
|
37
|
+
// frame can briefly mount this active boundary during hydration. Avoid a
|
|
38
|
+
// same-origin config request before the parent switches to disabled mode.
|
|
39
|
+
if (isPreviewFrameRuntime()) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
35
42
|
let active = true;
|
|
36
43
|
let refreshTimer = null;
|
|
37
44
|
const refresh = () => loadFunnelRuntimeConfig(funnelId, { versionId: funnelVersionId })
|