Show warning if there's uncommitted changes (#92)

This commit is contained in:
Will Chen
2025-05-06 11:07:31 -07:00
committed by GitHub
parent 43ec6a4563
commit c425daf893
8 changed files with 65 additions and 10 deletions

View File

@@ -111,10 +111,10 @@ export class IpcClient {
});
this.ipcRenderer.on("chat:response:end", (payload) => {
const { chatId, updatedFiles } = payload as unknown as ChatResponseEnd;
const { chatId } = payload as unknown as ChatResponseEnd;
const callbacks = this.chatStreams.get(chatId);
if (callbacks) {
callbacks.onEnd({ chatId, updatedFiles });
callbacks.onEnd(payload as unknown as ChatResponseEnd);
console.debug("chat:response:end");
this.chatStreams.delete(chatId);
} else {
@@ -734,13 +734,21 @@ export class IpcClient {
}: {
chatId: number;
messageId: number;
}): Promise<{ success: boolean; error?: string }> {
}): Promise<{
success: boolean;
error?: string;
uncommittedFiles?: string[];
}> {
try {
const result = await this.ipcRenderer.invoke("approve-proposal", {
chatId,
messageId,
});
return result as { success: boolean; error?: string };
return result as {
success: boolean;
error?: string;
uncommittedFiles?: string[];
};
} catch (error) {
showError(error);
return { success: false, error: (error as Error).message };