diff --git a/src/frontend/screens/DownloadManager/components/ProgressHeader/index.css b/src/frontend/screens/DownloadManager/components/ProgressHeader/index.css index d810ec8f40..7e1fceb481 100644 --- a/src/frontend/screens/DownloadManager/components/ProgressHeader/index.css +++ b/src/frontend/screens/DownloadManager/components/ProgressHeader/index.css @@ -54,6 +54,8 @@ .realtimeDownloadStat { white-space: nowrap; margin: 0px; + width: 6em; + text-align: start; } .realtimeDownloadStatLabel { @@ -66,7 +68,6 @@ .realtimeDownloadStatContainer { align-self: center; margin: 1em; - box-sizing: border-box; } .downloadRateChart { diff --git a/src/frontend/screens/DownloadManager/components/ProgressHeader/index.tsx b/src/frontend/screens/DownloadManager/components/ProgressHeader/index.tsx index 1ab81b20e0..a4ae1d7c48 100644 --- a/src/frontend/screens/DownloadManager/components/ProgressHeader/index.tsx +++ b/src/frontend/screens/DownloadManager/components/ProgressHeader/index.tsx @@ -20,19 +20,22 @@ export default function ProgressHeader(props: { appName: string state: DownloadManagerState }) { + const sampleSize = 100 const { t } = useTranslation() const [progress] = hasProgress(props.appName) const [avgSpeed, setAvgDownloadSpeed] = useState( - Array(20).fill({ download: 0, disk: 0 }) + Array(sampleSize).fill({ download: 0, disk: 0 }) ) useEffect(() => { if (props.state === 'idle') { - setAvgDownloadSpeed(Array(20).fill({ download: 0, disk: 0 })) + setAvgDownloadSpeed( + Array(sampleSize).fill({ download: 0, disk: 0 }) + ) return } - if (avgSpeed.length > 19) { + if (avgSpeed.length > sampleSize - 1) { avgSpeed.shift() }