Delete chat (#77)

This commit is contained in:
Will Chen
2025-05-02 15:43:40 -07:00
committed by GitHub
parent b9dc2cc0f9
commit 4e4bf51bba
4 changed files with 103 additions and 25 deletions

View File

@@ -277,7 +277,19 @@ export class IpcClient {
public async createChat(appId: number): Promise<number> {
try {
const chatId = await this.ipcRenderer.invoke("create-chat", appId);
return chatId;
return chatId as number;
} catch (error) {
showError(error);
throw error;
}
}
public async deleteChat(chatId: number): Promise<{ success: boolean }> {
try {
const result = (await this.ipcRenderer.invoke("delete-chat", chatId)) as {
success: boolean;
};
return result;
} catch (error) {
showError(error);
throw error;