mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: events working
This commit is contained in:
parent
3b17953a82
commit
811878e364
12 changed files with 182 additions and 82 deletions
|
@ -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"),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue