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

@@ -58,7 +58,10 @@ import { useVersions } from "@/hooks/useVersions";
import { useAttachments } from "@/hooks/useAttachments";
import { AttachmentsList } from "./AttachmentsList";
import { DragDropOverlay } from "./DragDropOverlay";
import {
showError as showErrorToast,
showUncommittedFilesWarning,
} from "@/lib/toast";
const showTokenBarAtom = atom(false);
export function ChatInput({ chatId }: { chatId?: number }) {
@@ -189,6 +192,9 @@ export function ChatInput({ chatId }: { chatId?: number }) {
console.error("Failed to approve proposal:", result.error);
setError(result.error || "Failed to approve proposal");
}
if (result.uncommittedFiles) {
showUncommittedFilesWarning(result.uncommittedFiles);
}
} catch (err) {
console.error("Error approving proposal:", err);
setError((err as Error)?.message || "An error occurred while approving");