Skip to content

Commit

Permalink
Merge pull request #14182 from Budibase/budi-8455-on-screen-load-open…
Browse files Browse the repository at this point in the history
…-side-panel-issue-side-panel-will-open

Add logic to prevent panel and modals from closing when screen load actions are available
  • Loading branch information
shogunpurple authored Jul 23, 2024
2 parents 9719e52 + c2fda97 commit 799643b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/client/src/components/ClientApp.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 799643b

Please sign in to comment.