@funnelsgrove/runtime 0.7.30 → 0.7.31
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.
|
@@ -33,12 +33,7 @@ function ActiveFunnelRuntimeConfigBoundary({ funnelId, funnelVersionId, children
|
|
|
33
33
|
error: null,
|
|
34
34
|
});
|
|
35
35
|
useEffect(() => {
|
|
36
|
-
|
|
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
|
-
}
|
|
36
|
+
const isPreviewFrame = isPreviewFrameRuntime();
|
|
42
37
|
let active = true;
|
|
43
38
|
let refreshTimer = null;
|
|
44
39
|
const refresh = () => loadFunnelRuntimeConfig(funnelId, { versionId: funnelVersionId })
|
|
@@ -64,7 +59,10 @@ function ActiveFunnelRuntimeConfigBoundary({ funnelId, funnelVersionId, children
|
|
|
64
59
|
: { status: 'fallback', config: null, error: toError(error) }));
|
|
65
60
|
});
|
|
66
61
|
void refresh().then(() => {
|
|
67
|
-
|
|
62
|
+
// Embedded previews are immutable for the lifetime of their iframe. They
|
|
63
|
+
// need the published config once, but must not multiply polling traffic
|
|
64
|
+
// by the number of step thumbnails open in the editor.
|
|
65
|
+
if (active && !isPreviewFrame) {
|
|
68
66
|
refreshTimer = setInterval(() => void refresh(), FUNNEL_RUNTIME_CONFIG_REFRESH_INTERVAL_MS);
|
|
69
67
|
}
|
|
70
68
|
});
|