summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/context
diff options
context:
space:
mode:
authorAdam <[email protected]>2026-01-22 10:54:41 -0600
committerAdam <[email protected]>2026-01-22 11:06:51 -0600
commitde6582b38b046f679d8a10b9def8bb4e780a1b19 (patch)
treec559828e5185ef14a34358b84ab7d76df47b960b /packages/app/src/context
parentfc53abe589cb8d86f8b4fd7df0c6b25aa4914602 (diff)
downloadopencode-de6582b38b046f679d8a10b9def8bb4e780a1b19.tar.gz
opencode-de6582b38b046f679d8a10b9def8bb4e780a1b19.zip
feat(app): delete sessions
Diffstat (limited to 'packages/app/src/context')
-rw-r--r--packages/app/src/context/global-sync.tsx14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/app/src/context/global-sync.tsx b/packages/app/src/context/global-sync.tsx
index 18eacbd60..4964ef6e4 100644
--- a/packages/app/src/context/global-sync.tsx
+++ b/packages/app/src/context/global-sync.tsx
@@ -475,6 +475,20 @@ function createGlobalSync() {
)
break
}
+ case "session.deleted": {
+ const result = Binary.search(store.session, event.properties.info.id, (s) => s.id)
+ if (result.found) {
+ setStore(
+ "session",
+ produce((draft) => {
+ draft.splice(result.index, 1)
+ }),
+ )
+ }
+ if (event.properties.info.parentID) break
+ setStore("sessionTotal", (value) => Math.max(0, value - 1))
+ break
+ }
case "session.diff":
setStore("session_diff", event.properties.sessionID, reconcile(event.properties.diff, { key: "file" }))
break