diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 9bfb1192ea7..763c8ef7717 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -106,12 +106,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() } }