feat: events working

This commit is contained in:
Zamitto 2024-05-19 14:15:07 -03:00
parent 3b17953a82
commit 811878e364
12 changed files with 182 additions and 82 deletions

View file

@ -115,6 +115,19 @@ contextBridge.exposeInMainWorld("electron", {
platform: process.platform,
/* Splash */
checkForUpdates: (cb: (value: AppUpdaterEvents) => void) =>
ipcRenderer.invoke("checkForUpdates", cb),
onAutoUpdaterEvent: (cb: (value: AppUpdaterEvents) => void) => {
const listener = (
_event: Electron.IpcRendererEvent,
value: AppUpdaterEvents
) => cb(value);
ipcRenderer.on("autoUpdaterEvent", listener);
return () => {
ipcRenderer.removeListener("autoUpdaterEvent", listener);
};
},
checkForUpdates: () => ipcRenderer.invoke("checkForUpdates"),
restartAndInstallUpdate: () => ipcRenderer.invoke("restartAndInstallUpdate"),
continueToMainWindow: () => ipcRenderer.invoke("continueToMainWindow"),
});