Load (canned) proposal from IPC

This commit is contained in:
Will Chen
2025-04-18 11:11:58 -07:00
parent 7aec3ef455
commit 4e0f93d21c
8 changed files with 191 additions and 45 deletions

View File

@@ -17,6 +17,7 @@ import type {
NodeSystemInfo,
Version,
} from "./ipc_types";
import type { Proposal } from "@/lib/schemas";
import { showError } from "@/lib/toast";
export interface ChatStreamCallbacks {
@@ -614,6 +615,18 @@ export class IpcClient {
}
}
// Get proposal details
public async getProposal(chatId: number): Promise<Proposal> {
try {
const data = await this.ipcRenderer.invoke("get-proposal", { chatId });
// Assuming the main process returns data matching the Proposal interface
return data as Proposal;
} catch (error) {
showError(error);
throw error;
}
}
// Example methods for listening to events (if needed)
// public on(channel: string, func: (...args: any[]) => void): void {
}