diff --git a/src/components/update/Progress/progress.module.scss b/src/components/update/Progress/progress.module.scss index 182d9af..a963e64 100644 --- a/src/components/update/Progress/progress.module.scss +++ b/src/components/update/Progress/progress.module.scss @@ -7,7 +7,7 @@ border: 1px solid #000; border-radius: 3px; height: 6px; - width: 100px; + width: 200px; } .progress-rate { diff --git a/src/components/update/index.tsx b/src/components/update/index.tsx index 083037c..732cb9a 100644 --- a/src/components/update/index.tsx +++ b/src/components/update/index.tsx @@ -39,6 +39,7 @@ const Update = () => { const onUpdateCanAvailable = useCallback((_event: Electron.IpcRendererEvent, arg1: VersionInfo) => { setVersionInfo(arg1) + setUpdateError(undefined) // Can be update if (arg1.update) { setModalBtn(state => ({ @@ -50,7 +51,6 @@ const Update = () => { setUpdateAvailable(true) } else { setUpdateAvailable(false) - setUpdateError(undefined) } }, []) @@ -89,8 +89,6 @@ const Update = () => { } }, []) - const isUpdate = updateAvailable && versionInfo - return ( <> { okText={modalBtn?.okText} onCancel={modalBtn?.onCancel} onOk={modalBtn?.onOk} - footer={isUpdate ? /* hide footer */null : undefined} + footer={updateAvailable ? /* hide footer */null : undefined} >
{updateError @@ -108,11 +106,11 @@ const Update = () => {

Error downloading the latest version.

{updateError.message}

- ) : isUpdate + ) : updateAvailable ? ( -
-
The last version is: v{versionInfo.newVersion}
-
v{versionInfo.version} -> v{versionInfo.newVersion}
+
+
The last version is: v{versionInfo?.newVersion}
+
v{versionInfo?.version} -> v{versionInfo?.newVersion}
Update progress:
@@ -121,7 +119,9 @@ const Update = () => {
) - :
Checking...
} + : ( +
Now is the last version: v{versionInfo?.version}.
+ )}