diff --git a/src/components/modules/downloads/DownloadsModule.tsx b/src/components/modules/downloads/DownloadsModule.tsx index accbf4033..2062b5fb5 100644 --- a/src/components/modules/downloads/DownloadsModule.tsx +++ b/src/components/modules/downloads/DownloadsModule.tsx @@ -19,6 +19,7 @@ import { useConfig } from '../../../tools/state'; import { AddItemShelfButton } from '../../AppShelf/AddAppShelfItem'; import { useSetSafeInterval } from '../../../tools/hooks/useSetSafeInterval'; import { useViewportSize } from '@mantine/hooks'; +import { humanFileSize } from '../../../tools/humanFileSize'; export const DownloadsModule: IModule = { title: 'Torrent', @@ -100,7 +101,7 @@ export default function DownloadComponent() { .map((torrent) => { const downloadSpeed = torrent.downloadSpeed / 1024 / 1024; const uploadSpeed = torrent.uploadSpeed / 1024 / 1024; - const size = torrent.totalSelected / (1024 * 1024); + const size = torrent.totalSelected; // Convert Seconds to readable format. function calculateETA(givenSeconds: number) { if (givenSeconds > 86399) { // No @@ -140,7 +141,7 @@ export default function DownloadComponent() { - {size > 0 ? (size > 999 ? `${(size / 1024).toFixed(1)} GB` : `${size.toFixed(1)} MB`) : '-' } + {humanFileSize(size)} {width > 576 ?