🐛 Fix a small bug inside the torrent module

This commit is contained in:
ajnart
2022-06-07 12:41:49 +02:00
parent b72afc2270
commit 4f1640b70a

View File

@@ -91,45 +91,44 @@ export default function DownloadComponent() {
</tr> </tr>
); );
// Loop over qBittorrent torrents merging with deluge torrents // Loop over qBittorrent torrents merging with deluge torrents
const rows = torrents.map((torrent) => { const rows = torrents
if (torrent.progress === 1 && hideComplete) { .filter((torrent) => !(torrent.progress === 1 && hideComplete))
return []; .map((torrent) => {
} const downloadSpeed = torrent.downloadSpeed / 1024 / 1024;
const downloadSpeed = torrent.downloadSpeed / 1024 / 1024; const uploadSpeed = torrent.uploadSpeed / 1024 / 1024;
const uploadSpeed = torrent.uploadSpeed / 1024 / 1024; return (
return ( <tr key={torrent.id}>
<tr key={torrent.id}> <td>
<td> <Tooltip position="top" label={torrent.name}>
<Tooltip position="top" label={torrent.name}> <Text
<Text style={{
style={{ maxWidth: '30vw',
maxWidth: '30vw', }}
}} size="xs"
size="xs" lineClamp={1}
lineClamp={1} >
> {torrent.name}
{torrent.name} </Text>
</Text> </Tooltip>
</Tooltip> </td>
</td> <td>
<td> <Text size="xs">{downloadSpeed > 0 ? `${downloadSpeed.toFixed(1)} Mb/s` : '-'}</Text>
<Text size="xs">{downloadSpeed > 0 ? `${downloadSpeed.toFixed(1)} Mb/s` : '-'}</Text> </td>
</td> <td>
<td> <Text size="xs">{uploadSpeed > 0 ? `${uploadSpeed.toFixed(1)} Mb/s` : '-'}</Text>
<Text size="xs">{uploadSpeed > 0 ? `${uploadSpeed.toFixed(1)} Mb/s` : '-'}</Text> </td>
</td> <td>
<td> <Text>{(torrent.progress * 100).toFixed(1)}%</Text>
<Text>{(torrent.progress * 100).toFixed(1)}%</Text> <Progress
<Progress radius="lg"
radius="lg" color={torrent.progress === 1 ? 'green' : 'blue'}
color={torrent.progress === 1 ? 'green' : 'blue'} value={torrent.progress * 100}
value={torrent.progress * 100} size="lg"
size="lg" />
/> </td>
</td> </tr>
</tr> );
); });
});
const easteregg = ( const easteregg = (
<Center style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}> <Center style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>