Skip to content

Commit 0b92149

Browse files
authored
trigger auto-layout when auto-layout setting is toggled on (#339)
1 parent e3eebe7 commit 0b92149

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ui/src/components/Sidebar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function SidebarSettings() {
5353
const setAutoRunLayout = useStore(store, (state) => state.setAutoRunLayout);
5454
const contextualZoom = useStore(store, (state) => state.contextualZoom);
5555
const setContextualZoom = useStore(store, (state) => state.setContextualZoom);
56+
const autoLayoutROOT = useStore(store, (state) => state.autoLayoutROOT);
5657
return (
5758
<Box>
5859
<Box>
@@ -89,6 +90,9 @@ function SidebarSettings() {
8990
color="warning"
9091
onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
9192
setAutoRunLayout(event.target.checked);
93+
if (event.target.checked) {
94+
autoLayoutROOT();
95+
}
9296
}}
9397
/>
9498
}

0 commit comments

Comments
 (0)