mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03:32:13 +00:00
silent install and add more info
This commit is contained in:
parent
811878e364
commit
b9f5baef34
2 changed files with 6 additions and 4 deletions
|
@ -7,7 +7,7 @@ const { autoUpdater } = updater;
|
||||||
|
|
||||||
const restartAndInstallUpdate = async (_event: Electron.IpcMainInvokeEvent) => {
|
const restartAndInstallUpdate = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||||
if (app.isPackaged) {
|
if (app.isPackaged) {
|
||||||
autoUpdater.quitAndInstall();
|
autoUpdater.quitAndInstall(true, true);
|
||||||
} else {
|
} else {
|
||||||
WindowManager.splashWindow?.close();
|
WindowManager.splashWindow?.close();
|
||||||
WindowManager.createMainWindow();
|
WindowManager.createMainWindow();
|
||||||
|
|
|
@ -10,6 +10,7 @@ document.body.classList.add(themeClass);
|
||||||
|
|
||||||
export default function Splash() {
|
export default function Splash() {
|
||||||
const [status, setStatus] = useState<AppUpdaterEvents | null>(null);
|
const [status, setStatus] = useState<AppUpdaterEvents | null>(null);
|
||||||
|
const [newVersion, setNewVersion] = useState("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("subscribing");
|
console.log("subscribing");
|
||||||
|
@ -27,6 +28,7 @@ export default function Splash() {
|
||||||
window.electron.continueToMainWindow();
|
window.electron.continueToMainWindow();
|
||||||
break;
|
break;
|
||||||
case "update-available":
|
case "update-available":
|
||||||
|
setNewVersion(event.info.version);
|
||||||
break;
|
break;
|
||||||
case "update-cancelled":
|
case "update-cancelled":
|
||||||
window.electron.continueToMainWindow();
|
window.electron.continueToMainWindow();
|
||||||
|
@ -53,14 +55,14 @@ export default function Splash() {
|
||||||
case "download-progress":
|
case "download-progress":
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p>Baixando</p>
|
<p>Baixando atualização {newVersion}</p>
|
||||||
<p>{status.info.percent}</p>
|
<p>{status.info.percent.toFixed(2)} %</p>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
case "checking-for-updates":
|
case "checking-for-updates":
|
||||||
return <p>Buscando atualizações</p>;
|
return <p>Buscando atualizações</p>;
|
||||||
case "update-available":
|
case "update-available":
|
||||||
return <p>Atualização encontrada</p>;
|
return <p>Atualização {status.info.version} encontrada</p>;
|
||||||
default:
|
default:
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue