code review: add listner once

This commit is contained in:
Michael Shanks 2020-06-09 06:22:00 +01:00
parent 2a2d9812b2
commit eea966a6ae
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()