code review: add listner once
This commit is contained in:
parent
7541ce91dd
commit
5799fbf23f
|
@ -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