Skip to content

Commit a00f596

Browse files
nedtwiggclaude
andcommitted
iframe-proxy: derive proxyOrigin instead of ternary-in-deps
Replace the ternary-in-dependency-array for the proxy-origin registration effect with a named derived value used by both the effect body and its dependency array. Same behavior, reads as a plain value. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f2c692a commit a00f596

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/src/components/wall/IframePanel.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ export function IframePanel({ api, params }: IDockviewPanelProps<IframePanelPara
7878

7979
// Trust postMessage from this frame's origin (validated by the Wall's
8080
// keyboard/focus channel) only while the proxied surface is live.
81+
const proxyOrigin = resolution.kind === 'proxied' ? resolution.origin : null;
8182
useEffect(() => {
82-
if (resolution.kind !== 'proxied' || !resolution.origin) return;
83-
return registerProxyOrigin(resolution.origin);
84-
}, [resolution.kind === 'proxied' ? resolution.origin : null]);
83+
if (!proxyOrigin) return;
84+
return registerProxyOrigin(proxyOrigin);
85+
}, [proxyOrigin]);
8586

8687
// Register a focus handle so onClickPanel → enterTerminalMode can focus the
8788
// frame like any other surface (spec → "#3"). Focusing the element moves

0 commit comments

Comments
 (0)