Fix iframe preview loading bug in old client library versions
This commit is contained in:
parent
330fd8b922
commit
ef88c740b2
|
@ -73,7 +73,17 @@
|
|||
// Initialise the app when mounted
|
||||
iframe.contentWindow.addEventListener(
|
||||
"ready",
|
||||
() => refreshContent(strippedJson),
|
||||
() => {
|
||||
loading = false
|
||||
refreshContent(strippedJson)
|
||||
},
|
||||
{ once: true }
|
||||
)
|
||||
|
||||
// Use iframe loading event to support old client versions
|
||||
iframe.contentWindow.addEventListener(
|
||||
"iframe-loaded",
|
||||
() => (loading = false),
|
||||
{ once: true }
|
||||
)
|
||||
|
||||
|
@ -98,7 +108,7 @@
|
|||
idToDelete = data.id
|
||||
confirmDeleteDialog.show()
|
||||
} else if (type === "preview-loaded") {
|
||||
loading = false
|
||||
// loading = false
|
||||
} else {
|
||||
console.warning(`Client sent unknown event type: ${type}`)
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ export default `
|
|||
if (window.loadBudibase) {
|
||||
window.loadBudibase()
|
||||
document.documentElement.classList.add("loaded")
|
||||
window.dispatchEvent(new Event("iframe-loaded"))
|
||||
} else {
|
||||
throw "The client library couldn't be loaded"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue