We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8da75e1 commit c30f06aCopy full SHA for c30f06a
1 file changed
packages/app/src/pages/layout.tsx
@@ -1409,19 +1409,20 @@ export default function Layout(props: ParentProps) {
1409
const index = list.findIndex((x) => pathKey(x.worktree) === key)
1410
const active = pathKey(currentProject()?.worktree ?? "") === key
1411
if (index === -1) return
1412
- const next = list[index + 1]
1413
1414
if (!active) {
1415
layout.projects.close(directory)
1416
return
1417
}
1418
1419
- if (!next) {
+ if (list.length === 1) {
1420
1421
navigate("/")
1422
1423
1424
+ const next = list[index + 1] ?? list[index - 1]
1425
+
1426
navigateWithSidebarReset(`/${base64Encode(next.worktree)}/session`)
1427
1428
queueMicrotask(() => {
0 commit comments