Browse Source

Revert "fix: expand workspaces by default when enabled"

This reverts commit 1fd496a5e25c762bdc3cadb261b255485bde3417.
David Hill 1 month ago
parent
commit
2190e8c656
1 changed files with 4 additions and 13 deletions
  1. 4 13
      packages/app/src/pages/layout.tsx

+ 4 - 13
packages/app/src/pages/layout.tsx

@@ -325,19 +325,10 @@ export default function Layout(props: ParentProps) {
   createEffect(() => {
     if (!pageReady()) return
     if (!layoutReady()) return
-    const project = currentProject()
-    if (!project) return
-
-    const enabled = layout.sidebar.workspaces(project.worktree)()
-    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)
-      }
+    for (const [directory, expanded] of Object.entries(store.workspaceExpanded)) {
+      if (layout.sidebar.workspaces(directory)()) continue
+      if (!expanded) continue
+      setStore("workspaceExpanded", directory, false)
     }
   })