Skip to content

Commit

Permalink
Add callback registration for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Dec 1, 2024
1 parent d90615e commit a03569a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a03569a

Please sign in to comment.