Refactor chat input & properly update state for proposal
This commit is contained in:
@@ -285,12 +285,12 @@ export function registerChatStreamHandlers() {
|
||||
chatId: req.chatId,
|
||||
updatedFiles: status.updatedFiles ?? false,
|
||||
} satisfies ChatResponseEnd);
|
||||
} else {
|
||||
event.sender.send("chat:response:end", {
|
||||
chatId: req.chatId,
|
||||
updatedFiles: false,
|
||||
} satisfies ChatResponseEnd);
|
||||
}
|
||||
} else {
|
||||
event.sender.send("chat:response:end", {
|
||||
chatId: req.chatId,
|
||||
updatedFiles: false,
|
||||
} satisfies ChatResponseEnd);
|
||||
}
|
||||
|
||||
// Return the chat ID for backwards compatibility
|
||||
|
||||
@@ -17,15 +17,9 @@ import type {
|
||||
Message,
|
||||
Version,
|
||||
} from "./ipc_types";
|
||||
import type { Proposal } from "@/lib/schemas";
|
||||
import type { Proposal, ProposalResult } from "@/lib/schemas";
|
||||
import { showError } from "@/lib/toast";
|
||||
|
||||
// Define the structure returned by getProposal
|
||||
interface ProposalResult {
|
||||
proposal: Proposal;
|
||||
messageId: number;
|
||||
}
|
||||
|
||||
export interface ChatStreamCallbacks {
|
||||
onUpdate: (messages: Message[]) => void;
|
||||
onEnd: (response: ChatResponseEnd) => void;
|
||||
|
||||
Reference in New Issue
Block a user