1
0
Fork 0
mirror of synced 2024-06-29 03:20:34 +12:00

Update develop with master bugfix and add comments to explain loading events

This commit is contained in:
Andrew Kingston 2021-07-07 13:21:30 +01:00
parent 67ffb2d96d
commit ac99f7a23b

View file

@ -74,14 +74,11 @@
// Initialise the app when mounted // Initialise the app when mounted
iframe.contentWindow.addEventListener( iframe.contentWindow.addEventListener(
"ready", "ready",
() => { () => refreshContent(strippedJson),
loading = false
refreshContent(strippedJson)
},
{ once: true } { once: true }
) )
// Use iframe loading event to support old client versions // Display the client app once the iframe is initialised
iframe.contentWindow.addEventListener( iframe.contentWindow.addEventListener(
"iframe-loaded", "iframe-loaded",
() => (loading = false), () => (loading = false),
@ -109,7 +106,11 @@
idToDelete = data.id idToDelete = data.id
confirmDeleteDialog.show() confirmDeleteDialog.show()
} else if (type === "preview-loaded") { } else if (type === "preview-loaded") {
// loading = false // We can use this in future to delay displaying the preview
// until the client app has actually initialised.
// This makes a smoother loading experience, but is not backwards
// compatible with old client library versions.
// So do nothing with this for now.
} else { } else {
console.warning(`Client sent unknown event type: ${type}`) console.warning(`Client sent unknown event type: ${type}`)
} }