summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/context/sync.tsx
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-12-12 07:07:54 -0600
committerAdam <[email protected]>2025-12-12 07:07:54 -0600
commitfeb8c4f3c60e1ada28bd24abd09d534375a6bc08 (patch)
treefc55e3bfe53c2707944a12c234e54287e7b1ff2f /packages/desktop/src/context/sync.tsx
parent3f5cd2c4a810168ed03094cbf1d3e51a4b62f261 (diff)
downloadopencode-feb8c4f3c60e1ada28bd24abd09d534375a6bc08.tar.gz
opencode-feb8c4f3c60e1ada28bd24abd09d534375a6bc08.zip
feat(desktop): archive sessions
Diffstat (limited to 'packages/desktop/src/context/sync.tsx')
-rw-r--r--packages/desktop/src/context/sync.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/desktop/src/context/sync.tsx b/packages/desktop/src/context/sync.tsx
index 85758c5b6..2ab54b3ae 100644
--- a/packages/desktop/src/context/sync.tsx
+++ b/packages/desktop/src/context/sync.tsx
@@ -65,6 +65,15 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
})
},
more: createMemo(() => store.session.length >= store.limit),
+ archive: async (sessionID: string) => {
+ await sdk.client.session.update({ sessionID, time: { archived: Date.now() } })
+ setStore(
+ produce((draft) => {
+ const match = Binary.search(draft.session, sessionID, (s) => s.id)
+ if (match.found) draft.session.splice(match.index, 1)
+ }),
+ )
+ },
},
absolute,
get directory() {