simplify events

This commit is contained in:
Zamitto 2024-05-21 17:04:06 -03:00
parent e3da07141c
commit b3480eb70b
2 changed files with 6 additions and 6 deletions

View File

@ -22,8 +22,8 @@ const checkForUpdates = async (_event: Electron.IpcMainInvokeEvent) => {
.addListener("checking-for-update", () => { .addListener("checking-for-update", () => {
sendEvent({ type: "checking-for-updates" }); sendEvent({ type: "checking-for-updates" });
}) })
.addListener("update-not-available", (info: UpdateInfo) => { .addListener("update-not-available", () => {
sendEvent({ type: "update-not-available", info }); sendEvent({ type: "update-not-available" });
}) })
.addListener("update-available", (info: UpdateInfo) => { .addListener("update-available", (info: UpdateInfo) => {
sendEvent({ type: "update-available", info }); sendEvent({ type: "update-available", info });
@ -34,8 +34,8 @@ const checkForUpdates = async (_event: Electron.IpcMainInvokeEvent) => {
.addListener("download-progress", (info: ProgressInfo) => { .addListener("download-progress", (info: ProgressInfo) => {
sendEvent({ type: "download-progress", info }); sendEvent({ type: "download-progress", info });
}) })
.addListener("update-cancelled", (info: UpdateInfo) => { .addListener("update-cancelled", () => {
sendEvent({ type: "update-cancelled", info }); sendEvent({ type: "update-cancelled" });
}); });
if (app.isPackaged) { if (app.isPackaged) {

View File

@ -148,8 +148,8 @@ export interface SteamGame {
export type AppUpdaterEvents = export type AppUpdaterEvents =
| { type: "error" } | { type: "error" }
| { type: "checking-for-updates" } | { type: "checking-for-updates" }
| { type: "update-not-available"; info: UpdateInfo } | { type: "update-not-available" }
| { type: "update-available"; info: UpdateInfo } | { type: "update-available"; info: UpdateInfo }
| { type: "update-downloaded" } | { type: "update-downloaded" }
| { type: "download-progress"; info: ProgressInfo } | { type: "download-progress"; info: ProgressInfo }
| { type: "update-cancelled"; info: UpdateInfo }; | { type: "update-cancelled" };