From 2d28ecc990f0bb9db85f76afdd8ab10121e0ff4e Mon Sep 17 00:00:00 2001 From: Someone <10882916+InterN0te@users.noreply.github.com> Date: Sun, 5 Nov 2023 17:39:37 +0100 Subject: [PATCH] Use dynamic unit for Torrent DownloadSpeed and UploadSpeed Use humanFileSize to display Torrent DownloadSpeed and UploadSpeed --- src/widgets/torrent/TorrentQueueItem.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/widgets/torrent/TorrentQueueItem.tsx b/src/widgets/torrent/TorrentQueueItem.tsx index eb5435872..f463b156f 100644 --- a/src/widgets/torrent/TorrentQueueItem.tsx +++ b/src/widgets/torrent/TorrentQueueItem.tsx @@ -39,8 +39,6 @@ export const BitTorrentQueueItem = ({ torrent, width, app }: TorrentQueueItemPro const { classes } = useStyles(); const { t } = useTranslation('modules/torrents-status'); - const downloadSpeed = torrent.downloadSpeed / 1024 / 1024; - const uploadSpeed = torrent.uploadSpeed / 1024 / 1024; const size = torrent.totalSelected; return ( MIN_WIDTH_MOBILE && ( - {downloadSpeed > 0 ? `${downloadSpeed.toFixed(1)} MB/s` : '-'} + {torrent.downloadSpeed > 0 ? `${humanFileSize(torrent.downloadSpeed,false)}/s` : '-'} )} {width > MIN_WIDTH_MOBILE && ( - {uploadSpeed > 0 ? `${uploadSpeed.toFixed(1)} MB/s` : '-'} + {torrent.uploadSpeed > 0 ? `${humanFileSize(torrent.uploadSpeed,false)}/s` : '-'} )}