Use client features to determine when to show client preview on initial load
This commit is contained in:
parent
7040ee48f4
commit
db276468aa
|
@ -74,14 +74,14 @@
|
||||||
// Initialise the app when mounted
|
// Initialise the app when mounted
|
||||||
iframe.contentWindow.addEventListener(
|
iframe.contentWindow.addEventListener(
|
||||||
"ready",
|
"ready",
|
||||||
() => refreshContent(strippedJson),
|
() => {
|
||||||
{ once: true }
|
// Display preview immediately if the intelligent loading feature
|
||||||
)
|
// is not supported
|
||||||
|
if (!$store.clientFeatures.intelligentLoading) {
|
||||||
// Display the client app once the iframe is initialised
|
loading = false
|
||||||
iframe.contentWindow.addEventListener(
|
}
|
||||||
"iframe-loaded",
|
refreshContent(strippedJson)
|
||||||
() => (loading = false),
|
},
|
||||||
{ once: true }
|
{ once: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -106,11 +106,9 @@
|
||||||
idToDelete = data.id
|
idToDelete = data.id
|
||||||
confirmDeleteDialog.show()
|
confirmDeleteDialog.show()
|
||||||
} else if (type === "preview-loaded") {
|
} else if (type === "preview-loaded") {
|
||||||
// We can use this in future to delay displaying the preview
|
// Wait for this event to show the client library if intelligent
|
||||||
// until the client app has actually initialised.
|
// loading is supported
|
||||||
// This makes a smoother loading experience, but is not backwards
|
loading = false
|
||||||
// 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}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue