From 6eeffb43ef2b7296e5dbea42b019ee2d7bfe73e3 Mon Sep 17 00:00:00 2001 From: Conor Webb Date: Tue, 16 Jul 2024 12:59:43 +0100 Subject: [PATCH 1/2] Add logic to prevent sidepanel and modals from closing when onload actions are active. --- packages/client/src/components/ClientApp.svelte | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 9bfb1192ea..3d68b3bea7 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -51,6 +51,7 @@ let dataLoaded = false let permissionError = false let embedNoScreens = false + let onLoadCheck = false // Determine if we should show devtools or not $: showDevTools = $devToolsEnabled && !$routeStore.queryParams?.peek @@ -106,12 +107,24 @@ } const handleHashChange = () => { const { open: sidePanelOpen } = $sidePanelStore - if (sidePanelOpen) { + // only close if the sidepanel is open and theres no onload side panel actions on the screen. + if ( + sidePanelOpen && + !$screenStore.activeScreen.onLoad?.some( + item => item["##eventHandlerType"] === "Open Side Panel" + ) + ) { sidePanelStore.actions.close() } const { open: modalOpen } = $modalStore - if (modalOpen) { + // only close if the modal is open and theres onload modals actions on the screen. + if ( + modalOpen && + !$screenStore.activeScreen.onLoad?.some( + item => item["##eventHandlerType"] === "Open Modal" + ) + ) { modalStore.actions.close() } } From e2343073f0ecc802600df8ca02f9a210f6d5f6d2 Mon Sep 17 00:00:00 2001 From: Conor Webb Date: Tue, 16 Jul 2024 13:05:41 +0100 Subject: [PATCH 2/2] Remove unused variable --- packages/client/src/components/ClientApp.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 3d68b3bea7..763c8ef771 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -51,7 +51,6 @@ let dataLoaded = false let permissionError = false let embedNoScreens = false - let onLoadCheck = false // Determine if we should show devtools or not $: showDevTools = $devToolsEnabled && !$routeStore.queryParams?.peek