Fix undo and redo by using initial commit hash for chat (#94)

This commit is contained in:
Will Chen
2025-05-06 12:15:42 -07:00
committed by GitHub
parent 390496f8f8
commit 20362d7b08
10 changed files with 434 additions and 101 deletions

View File

@@ -330,12 +330,24 @@ export class IpcClient {
}
}
public async deleteChat(chatId: number): Promise<{ success: boolean }> {
public async deleteChat(
chatId: number
): Promise<{ success: boolean; error?: string }> {
try {
const result = (await this.ipcRenderer.invoke("delete-chat", chatId)) as {
success: boolean;
};
return result;
const result = await this.ipcRenderer.invoke("delete-chat", chatId);
return result as { success: boolean; error?: string };
} catch (error) {
showError(error);
throw error;
}
}
public async deleteMessages(
chatId: number
): Promise<{ success: boolean; error?: string }> {
try {
const result = await this.ipcRenderer.invoke("delete-messages", chatId);
return result as { success: boolean; error?: string };
} catch (error) {
showError(error);
throw error;