Revert "fix: expand workspaces by default when enabled"
This reverts commit 1fd496a5e2.
This commit is contained in:
@@ -325,19 +325,10 @@ export default function Layout(props: ParentProps) {
|
|||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
if (!pageReady()) return
|
if (!pageReady()) return
|
||||||
if (!layoutReady()) return
|
if (!layoutReady()) return
|
||||||
const project = currentProject()
|
for (const [directory, expanded] of Object.entries(store.workspaceExpanded)) {
|
||||||
if (!project) return
|
if (layout.sidebar.workspaces(directory)()) continue
|
||||||
|
if (!expanded) continue
|
||||||
const enabled = layout.sidebar.workspaces(project.worktree)()
|
setStore("workspaceExpanded", directory, false)
|
||||||
const dirs = [project.worktree, ...(project.sandboxes ?? [])]
|
|
||||||
|
|
||||||
for (const directory of dirs) {
|
|
||||||
const expanded = store.workspaceExpanded[directory]
|
|
||||||
if (enabled && expanded === undefined) {
|
|
||||||
setStore("workspaceExpanded", directory, true)
|
|
||||||
} else if (!enabled && expanded) {
|
|
||||||
setStore("workspaceExpanded", directory, false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user