From 406776088d618b4df06492d76092b18a2a86e7a4 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 22 Mar 2022 18:15:41 +0000 Subject: [PATCH] Add identifier to messages sent to client iframe preview to avoid conflicts with embedded iframe events --- .../src/components/design/AppPreview/CurrentItemPreview.svelte | 1 + .../builder/src/components/design/AppPreview/iframeTemplate.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte index 8bf8570d31..28bc50d15a 100644 --- a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte @@ -68,6 +68,7 @@ customTheme: $store.customTheme, previewDevice: $store.previewDevice, messagePassing: $store.clientFeatures.messagePassing, + isBudibaseEvent: true } $: json = JSON.stringify(previewData) diff --git a/packages/builder/src/components/design/AppPreview/iframeTemplate.js b/packages/builder/src/components/design/AppPreview/iframeTemplate.js index 15321c5eff..c265a64d53 100644 --- a/packages/builder/src/components/design/AppPreview/iframeTemplate.js +++ b/packages/builder/src/components/design/AppPreview/iframeTemplate.js @@ -52,7 +52,7 @@ export default ` console.error("Client received invalid JSON") // Ignore } - if (!parsed) { + if (!parsed || !parsed.isBudibaseEvent) { return }