Skip to content

Commit 160af7a

Browse files
committed
Fix registering frames for sse sandboxes
1 parent 4b74200 commit 160af7a

File tree

1 file changed

+6
-1
lines changed
  • packages/app/src/app/components/Preview

1 file changed

+6
-1
lines changed

packages/app/src/app/components/Preview/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,12 @@ class BasePreview extends React.Component<Props, State> {
360360
handleMessage = (data: Object, source: any) => {
361361
if (data && data.codesandbox) {
362362
if (data.type === 'initialized' && source) {
363-
registerFrame(source, frameUrl(this.props.sandbox.id));
363+
registerFrame(
364+
source,
365+
this.serverPreview
366+
? getSSEUrl(this.props.sandbox.id)
367+
: frameUrl(this.props.sandbox.id)
368+
);
364369

365370
if (!this.state.frameInitialized && this.props.onInitialized) {
366371
this.disposeInitializer = this.props.onInitialized(this);

0 commit comments

Comments
 (0)