diff --git a/src/preload.ts b/src/preload.ts index b3236eff..6a0e5420 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -215,6 +215,12 @@ const electronAPI = { restoreCustomNodes: () => { return ipcRenderer.invoke(IPC_CHANNELS.RESTORE_CUSTOM_NODES); }, + onRestoreCustomNodes: (callback: (message: { total: number, index?: number, exitCode?: number }) => void) => { + ipcRenderer.on(IPC_CHANNELS.RESTORE_CUSTOM_NODES_PROGRESS, (_event, value) => { + console.info(`Received ${IPC_CHANNELS.RESTORE_CUSTOM_NODES_PROGRESS} event`, value); + callback(value); + }); + }, } as const; export type ElectronAPI = typeof electronAPI;