-
- {t('update.downloading-update')}
+ (toastId) => (
+
{
+ setIsDownloading(false);
+ }}
+ >
+ {
+ setIsDownloading(false);
+ toast.dismiss(toastId);
+ }}
+ >
+
+ {t('update.downloading-in-progress')}
+
+
+ {t('update.click-to-stop')}
+
-
-
- {Math.round(downloadProgress)}% {t('update.complete')}
-
-
+
+
),
- {
- id: 'download-progress',
- duration: Infinity,
- }
+ { id: 'download-progress', duration: Infinity }
);
}
}, [downloadProgress, isDownloading, t]);
const onUpdateDownloaded = useCallback(
(_event: Electron.IpcRendererEvent) => {
- toast.dismiss('download-progress');
setIsDownloading(false);
- toast.success(t('update.download-completed'), {
- description: t('update.click-to-install-update'),
- action: {
- label: t('update.install'),
- onClick: () => window.ipcRenderer.invoke('quit-and-install'),
- },
- duration: Infinity,
- });
+ toast.dismiss('download-progress');
+
+ toast.custom(
+ (toastId) => (
+
+
+
+ {t('update.ready-to-install')}
+
+ window.ipcRenderer.invoke('quit-and-install')}
+ >
+ {t('update.click-to-restart')}
+
+
+
+ ),
+ { id: 'update-downloaded', duration: Infinity }
+ );
},
[t]
);
diff --git a/src/i18n/locales/en-us/update.json b/src/i18n/locales/en-us/update.json
index d3b8004ab..77868ad34 100644
--- a/src/i18n/locales/en-us/update.json
+++ b/src/i18n/locales/en-us/update.json
@@ -7,5 +7,10 @@
"complete": "Complete",
"download-completed": "Download completed",
"click-to-install-update": "Click to install update",
- "install": "Install"
+ "install": "Install",
+ "update-eigent": "Update Eigent",
+ "downloading-in-progress": "Downloading in progress.",
+ "click-to-stop": "Click to stop.",
+ "ready-to-install": "Ready to install.",
+ "click-to-restart": "Click to restart."
}