code review: add listner once

This commit is contained in:
Michael Shanks 2020-06-09 06:22:00 +01:00
parent 7541ce91dd
commit 5799fbf23f
1 changed files with 2 additions and 5 deletions

View File

@ -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()