From b9f5baef3465911fb6927cdf6df18eb7ee932001 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 19 May 2024 14:39:44 -0300 Subject: [PATCH] silent install and add more info --- src/main/events/autoupdater/restart-and-install-update.ts | 2 +- src/renderer/src/pages/splash/splash.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/events/autoupdater/restart-and-install-update.ts b/src/main/events/autoupdater/restart-and-install-update.ts index f54c2b0b..e0e9495c 100644 --- a/src/main/events/autoupdater/restart-and-install-update.ts +++ b/src/main/events/autoupdater/restart-and-install-update.ts @@ -7,7 +7,7 @@ const { autoUpdater } = updater; const restartAndInstallUpdate = async (_event: Electron.IpcMainInvokeEvent) => { if (app.isPackaged) { - autoUpdater.quitAndInstall(); + autoUpdater.quitAndInstall(true, true); } else { WindowManager.splashWindow?.close(); WindowManager.createMainWindow(); diff --git a/src/renderer/src/pages/splash/splash.tsx b/src/renderer/src/pages/splash/splash.tsx index b777270f..64d7001b 100644 --- a/src/renderer/src/pages/splash/splash.tsx +++ b/src/renderer/src/pages/splash/splash.tsx @@ -10,6 +10,7 @@ document.body.classList.add(themeClass); export default function Splash() { const [status, setStatus] = useState(null); + const [newVersion, setNewVersion] = useState(""); useEffect(() => { console.log("subscribing"); @@ -27,6 +28,7 @@ export default function Splash() { window.electron.continueToMainWindow(); break; case "update-available": + setNewVersion(event.info.version); break; case "update-cancelled": window.electron.continueToMainWindow(); @@ -53,14 +55,14 @@ export default function Splash() { case "download-progress": return ( <> -

Baixando

-

{status.info.percent}

+

Baixando atualização {newVersion}

+

{status.info.percent.toFixed(2)} %

); case "checking-for-updates": return

Buscando atualizações

; case "update-available": - return

Atualização encontrada

; + return

Atualização {status.info.version} encontrada

; default: return <>; }