From 6e439c7eb522af65de7d522389569d56a6f92aca Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 7 Mar 2022 10:17:05 +0000 Subject: [PATCH] Properly remove window event listener when unmounting component preview --- .../AppPreview/CurrentItemPreview.svelte | 3 +- packages/client/stats.html | 2689 +++++++++++++++++ 2 files changed, 2691 insertions(+), 1 deletion(-) create mode 100644 packages/client/stats.html diff --git a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte index 2a886fab0c..de50e0cfb2 100644 --- a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte @@ -134,8 +134,9 @@ // Remove all iframe event listeners on component destroy onDestroy(() => { + window.removeEventListener("message", receiveMessage) + if (iframe.contentWindow) { - window.removeEventListener("message", receiveMessage) if (!$store.clientFeatures.messagePassing) { // Legacy - remove in later versions of BB iframe.contentWindow.removeEventListener( diff --git a/packages/client/stats.html b/packages/client/stats.html new file mode 100644 index 0000000000..509a3b0175 --- /dev/null +++ b/packages/client/stats.html @@ -0,0 +1,2689 @@ + + + + + + + + RollUp Visualizer + + + +
+ + + + +