feat(desktop): archive sessions

This commit is contained in:
Adam 2025-12-12 07:07:54 -06:00
commit feb8c4f3c6
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
5 changed files with 108 additions and 54 deletions

View file

@ -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() {