diff --git a/ui/src/routes/devices.$id.settings.general.update.tsx b/ui/src/routes/devices.$id.settings.general.update.tsx index 5269d5eb..7e3f6633 100644 --- a/ui/src/routes/devices.$id.settings.general.update.tsx +++ b/ui/src/routes/devices.$id.settings.general.update.tsx @@ -189,8 +189,6 @@ function UpdatingDeviceState({ otaState: UpdateState["otaState"]; onMinimizeUpgradeDialog: () => void; }) { - const formatProgress = (progress: number) => `${Math.round(progress)}%`; - const calculateOverallProgress = (type: "system" | "app") => { const downloadProgress = Math.round((otaState[`${type}DownloadProgress`] || 0) * 100); const updateProgress = Math.round((otaState[`${type}UpdateProgress`] || 0) * 100); @@ -258,6 +256,11 @@ function UpdatingDeviceState({ ); }; + const systemOverallProgress = calculateOverallProgress("system"); + const systemUpdateStatus = getUpdateStatus("system"); + const appOverallProgress = calculateOverallProgress("app"); + const appUpdateStatus = getUpdateStatus("app"); + return (
{m.general_update_system_update_title()}
- {calculateOverallProgress("system") < 100 ? ( + {systemOverallProgress < 100 ? ({m.general_update_app_update_title()}
- {calculateOverallProgress("app") < 100 ? ( + {appOverallProgress < 100 ? (
{versionInfo?.systemUpdateAvailable ? (
<>
- {m.general_update_system_type()}: {versionInfo?.remote?.systemVersion}
+ {m.general_update_system_type()}: {versionInfo?.remote?.systemVersion}
>
) : null}
{versionInfo?.appUpdateAvailable ? (
<>
- {m.general_update_application_type()}: {versionInfo?.remote?.appVersion}
+ {m.general_update_application_type()}: {versionInfo?.remote?.appVersion}
>
) : null}