Skip to content

Commit 302d772

Browse files
committed
wip
1 parent 2bc0a4c commit 302d772

File tree

1 file changed

+12
-12
lines changed
  • packages/signals/signals/src/core/processor

1 file changed

+12
-12
lines changed

packages/signals/signals/src/core/processor/sandbox.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ export class NoopSandbox implements SignalSandbox {
252252
export class IframeSandbox implements SignalSandbox {
253253
private iframe: HTMLIFrameElement
254254
private iframeReady: Promise<void>
255-
private _resolveReady!: () => void
256255
edgeFnUrl: string
257256

258257
constructor(edgeFnUrl: string, processSignalFn?: string) {
@@ -263,17 +262,18 @@ export class IframeSandbox implements SignalSandbox {
263262
this.iframe.style.display = 'none'
264263
this.iframe.src = 'about:blank'
265264
document.body.appendChild(this.iframe)
266-
this.iframeReady = new Promise((res) => {
267-
this._resolveReady = res
268-
})
269-
270-
void window.addEventListener('message', (e) => {
271-
if (e.source === this.iframe.contentWindow && e.data === 'iframe_ready') {
272-
this.iframe.contentWindow!.postMessage({
273-
type: 'init',
274-
})
275-
this._resolveReady()
276-
}
265+
this.iframeReady = new Promise((resolve) => {
266+
void window.addEventListener('message', (e) => {
267+
if (
268+
e.source === this.iframe.contentWindow &&
269+
e.data === 'iframe_ready'
270+
) {
271+
this.iframe.contentWindow!.postMessage({
272+
type: 'init',
273+
})
274+
resolve()
275+
}
276+
})
277277
})
278278

279279
const doc = this.iframe.contentDocument!

0 commit comments

Comments
 (0)