Load (canned) proposal from IPC
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user