Browse Source

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

pull/1944/head
Andrew Kingston 5 years ago
parent
commit
4dec87795a
  1. 13
      packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte

13
packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte

@ -74,14 +74,11 @@
// Initialise the app when mounted
iframe.contentWindow.addEventListener(
"ready",
() => {
loading = false
refreshContent(strippedJson)
},
() => refreshContent(strippedJson),
{ once: true }
)
// Use iframe loading event to support old client versions
// Display the client app once the iframe is initialised
iframe.contentWindow.addEventListener(
"iframe-loaded",
() => (loading = false),
@ -109,7 +106,11 @@
idToDelete = data.id
confirmDeleteDialog.show()
} 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 {
console.warning(`Client sent unknown event type: ${type}`)
}

Loading…
Cancel
Save