mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-21 21:35:18 +01:00
Fix transmission leech and seed showing NaN
This commit is contained in:
parent
65755a08aa
commit
149ed8c266
@ -30,8 +30,8 @@ export default function Component({ service }) {
|
|||||||
|
|
||||||
const rateDl = torrents.reduce((acc, torrent) => acc + torrent.rateDownload, 0);
|
const rateDl = torrents.reduce((acc, torrent) => acc + torrent.rateDownload, 0);
|
||||||
const rateUl = torrents.reduce((acc, torrent) => acc + torrent.rateUpload, 0);
|
const rateUl = torrents.reduce((acc, torrent) => acc + torrent.rateUpload, 0);
|
||||||
const completed = torrents.filter((torrent) => torrent.percentDone === 1);
|
const completed = torrents.filter((torrent) => torrent.percentDone === 1)?.length || 0;
|
||||||
const leech = torrents.length - completed;
|
const leech = torrents.length - completed || 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user