Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"main": "dist-electron/main/index.mjs",
"scripts": {
"build:core": "pnpm --dir ../../packages/core build",
"predev": "pnpm build:core",
"predev": "pnpm build:core && pnpm build:electron",
"dev": "concurrently -k \"vite --host 127.0.0.1\" \"wait-on tcp:5173 && cross-env VITE_DEV_SERVER_URL=http://127.0.0.1:5173 electron .\"",
"prebuild": "pnpm build:core",
"build:electron": "tsup",
Expand Down
2 changes: 2 additions & 0 deletions apps/desktop/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { AppSettings } from "./app-settings";
import { listCodexThemes } from "./themes";
import {
archiveSession,
deleteSession,
listSessions,
setSessionPinned,
unarchiveSession,
Expand Down Expand Up @@ -254,6 +255,7 @@ function registerIpc(): void {
ipcMain.handle("sessions:pin", (_event, id: string, pinned: boolean) => setSessionPinned(id, pinned));
ipcMain.handle("sessions:archive", (_event, id: string) => archiveSession(id));
ipcMain.handle("sessions:unarchive", (_event, id: string) => unarchiveSession(id));
ipcMain.handle("sessions:delete", (_event, id: string) => deleteSession(id));

ipcMain.handle("auth:status", async (): Promise<ProviderStatus[]> => {
const credentialStore = await createDSCodeCredentialStore();
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/src/main/session-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export async function unarchiveSession(id: string): Promise<SessionSummary | und
});
}

export async function deleteSession(id: string): Promise<boolean> {
return withStore((store) => store.delete(id));
}

function toSessionSummary(thread: Awaited<ReturnType<typeof listDSCodeThreads>>[number]): SessionSummary {
return {
path: thread.sessionPath,
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const api: DesktopApi & { onAppCommand(listener: (command: string) => void): ()
pin: (id, pinned) => ipcRenderer.invoke("sessions:pin", id, pinned),
archive: (id) => ipcRenderer.invoke("sessions:archive", id),
unarchive: (id) => ipcRenderer.invoke("sessions:unarchive", id),
delete: (id) => ipcRenderer.invoke("sessions:delete", id),
},
auth: {
status: () => ipcRenderer.invoke("auth:status"),
Expand Down
Loading
Loading