refactor: change open recipe in new window to pass recipe id (#7392)
This commit is contained in:
+12
-25
@@ -89,6 +89,15 @@ interface UpdaterEvent {
|
||||
data?: unknown;
|
||||
}
|
||||
|
||||
export interface CreateChatWindowOptions {
|
||||
query?: string;
|
||||
dir?: string;
|
||||
version?: string;
|
||||
resumeSessionId?: string;
|
||||
viewType?: string;
|
||||
recipeId?: string;
|
||||
}
|
||||
|
||||
// Define the API types in a single place
|
||||
type ElectronAPI = {
|
||||
platform: string;
|
||||
@@ -96,14 +105,7 @@ type ElectronAPI = {
|
||||
getConfig: () => Record<string, unknown>;
|
||||
hideWindow: () => void;
|
||||
directoryChooser: () => Promise<Electron.OpenDialogReturnValue>;
|
||||
createChatWindow: (
|
||||
query?: string,
|
||||
dir?: string,
|
||||
version?: string,
|
||||
resumeSessionId?: string,
|
||||
viewType?: string,
|
||||
recipeDeeplink?: string
|
||||
) => void;
|
||||
createChatWindow: (options?: CreateChatWindowOptions) => void;
|
||||
logInfo: (txt: string) => void;
|
||||
showNotification: (data: NotificationData) => void;
|
||||
showMessageBox: (options: MessageBoxOptions) => Promise<MessageBoxResponse>;
|
||||
@@ -188,23 +190,8 @@ const electronAPI: ElectronAPI = {
|
||||
},
|
||||
hideWindow: () => ipcRenderer.send('hide-window'),
|
||||
directoryChooser: () => ipcRenderer.invoke('directory-chooser'),
|
||||
createChatWindow: (
|
||||
query?: string,
|
||||
dir?: string,
|
||||
version?: string,
|
||||
resumeSessionId?: string,
|
||||
viewType?: string,
|
||||
recipeDeeplink?: string
|
||||
) =>
|
||||
ipcRenderer.send(
|
||||
'create-chat-window',
|
||||
query,
|
||||
dir,
|
||||
version,
|
||||
resumeSessionId,
|
||||
viewType,
|
||||
recipeDeeplink
|
||||
),
|
||||
createChatWindow: (options?: CreateChatWindowOptions) =>
|
||||
ipcRenderer.send('create-chat-window', options || {}),
|
||||
logInfo: (txt: string) => ipcRenderer.send('logInfo', txt),
|
||||
showNotification: (data: NotificationData) => ipcRenderer.send('notify', data),
|
||||
showMessageBox: (options: MessageBoxOptions) => ipcRenderer.invoke('show-message-box', options),
|
||||
|
||||
Reference in New Issue
Block a user