feat: show notification only when update is ready to install

This commit is contained in:
Zamitto 2024-07-05 12:10:19 -03:00
parent b09f2c055f
commit d2b3017de9
4 changed files with 8 additions and 23 deletions

View file

@ -3,10 +3,7 @@ import { registerEvent } from "../register-event";
import updater, { UpdateInfo } from "electron-updater";
import { WindowManager } from "@main/services";
import { app } from "electron";
import {
publishNotificationUpdateAvailable,
publishNotificationUpdateReadyToInstall,
} from "@main/services/notifications";
import { publishNotificationUpdateReadyToInstall } from "@main/services/notifications";
const { autoUpdater } = updater;
@ -28,9 +25,6 @@ const checkForUpdates = async (_event: Electron.IpcMainInvokeEvent) => {
autoUpdater
.once("update-available", (info: UpdateInfo) => {
sendEvent({ type: "update-available", info });
if (!isAutoInstallAvailable) {
publishNotificationUpdateAvailable();
}
})
.once("update-downloaded", () => {
sendEvent({ type: "update-downloaded" });