Show warning if there's uncommitted changes (#92)
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user