From f14e6d8e22807bbdfd52c88d8f7ff788f89df330 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 Nov 2021 13:15:31 +0000 Subject: [PATCH] Remove unused client event for iframe-loaded --- .../components/design/AppPreview/CurrentItemPreview.svelte | 5 ++++- .../src/components/design/AppPreview/iframeTemplate.js | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte index 25dd74e0d1..8e3e2dc21d 100644 --- a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte @@ -36,7 +36,6 @@ // Messages that can be sent from the iframe preview to the builder // Budibase events are and initalisation events const MessageTypes = { - IFRAME_LOADED: "iframe-loaded", READY: "ready", ERROR: "error", BUDIBASE: "type", @@ -157,6 +156,10 @@ const handleBudibaseEvent = event => { const { type, data } = event.data || event.detail + if (!type) { + return + } + if (type === "select-component" && data.id) { store.actions.components.select({ _id: data.id }) } else if (type === "update-prop") { diff --git a/packages/builder/src/components/design/AppPreview/iframeTemplate.js b/packages/builder/src/components/design/AppPreview/iframeTemplate.js index 05192fa4d3..e8c563db9f 100644 --- a/packages/builder/src/components/design/AppPreview/iframeTemplate.js +++ b/packages/builder/src/components/design/AppPreview/iframeTemplate.js @@ -84,7 +84,6 @@ export default ` if (window.loadBudibase) { window.loadBudibase() document.documentElement.classList.add("loaded") - window.parent.postMessage({ type: "iframe-loaded" }) } else { throw "The client library couldn't be loaded" }