diff options
| author | Rahul A Mistry <[email protected]> | 2026-02-03 17:49:56 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-03 06:19:56 -0600 |
| commit | 08671e315569b8fa82c1137db194b9ee9fa20ba4 (patch) | |
| tree | 760aa6e3f44b2ae395ee03badd3503d0e54d0cad /packages/app/src/context/layout.tsx | |
| parent | 0d557721cffc2cfb17e3b40354f94f5ee00393d0 (diff) | |
| download | opencode-08671e315569b8fa82c1137db194b9ee9fa20ba4.tar.gz opencode-08671e315569b8fa82c1137db194b9ee9fa20ba4.zip | |
fix(app): session tabs to open the previous opened (#11914)
Diffstat (limited to 'packages/app/src/context/layout.tsx')
| -rw-r--r-- | packages/app/src/context/layout.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/app/src/context/layout.tsx b/packages/app/src/context/layout.tsx index d30fd11cf..28fe628a8 100644 --- a/packages/app/src/context/layout.tsx +++ b/packages/app/src/context/layout.tsx @@ -682,12 +682,15 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext( if (!current) return const all = current.all.filter((x) => x !== tab) - batch(() => { + if (current.active !== tab) { setStore("sessionTabs", session, "all", all) - if (current.active !== tab) return + return + } - const index = current.all.findIndex((f) => f === tab) - const next = all[index - 1] ?? all[0] + const index = current.all.findIndex((f) => f === tab) + const next = current.all[index - 1] ?? current.all[index + 1] ?? all[0] + batch(() => { + setStore("sessionTabs", session, "all", all) setStore("sessionTabs", session, "active", next) }) }, |
