code review: add listner once
This commit is contained in:
parent
2a2d9812b2
commit
eea966a6ae
|
@ -110,11 +110,8 @@
|
|||
frontendDefinition,
|
||||
}))
|
||||
}
|
||||
let iframeLoaded = false
|
||||
$: if(iframe && !iframeLoaded) {
|
||||
iframe.contentWindow.addEventListener("bb-ready", refreshContent)
|
||||
iframeLoaded = true
|
||||
}
|
||||
|
||||
$: if(iframe) iframe.contentWindow.addEventListener("bb-ready", refreshContent, { once: true })
|
||||
|
||||
$: if(iframe && frontendDefinition) {
|
||||
refreshContent()
|
||||
|
|
Loading…
Reference in New Issue