feat: handle auto update for macos

This commit is contained in:
Zamitto 2024-05-31 13:17:12 -03:00
parent 2138aa9711
commit 45f30a9208
9 changed files with 92 additions and 56 deletions

View file

@ -15,13 +15,15 @@ const mockValuesForDebug = () => {
};
const checkForUpdates = async (_event: Electron.IpcMainInvokeEvent) => {
autoUpdater
.once("update-available", (info: UpdateInfo) => {
sendEvent({ type: "update-available", info });
})
.once("update-downloaded", () => {
autoUpdater.once("update-available", (info: UpdateInfo) => {
sendEvent({ type: "update-available", info });
});
if (process.platform !== "darwin") {
autoUpdater.once("update-downloaded", () => {
sendEvent({ type: "update-downloaded" });
});
}
if (app.isPackaged) {
autoUpdater.checkForUpdates();