Provided a more unique key to the rendering in qBittorrent widget

This commit is contained in:
Diogo Silva 2022-12-24 03:01:41 +01:00
parent e9aeed1f92
commit 15b78a2f73

View File

@ -139,7 +139,7 @@ export default function Component({ service }) {
const leech = torrentData.length - completed; const leech = torrentData.length - completed;
const torrentsEnabled = service.widget.fields === null || service.widget.fields?.includes('torrents'); const torrentsEnabled = service.widget.fields === null || service.widget.fields?.includes('torrents');
return ( return (
<> <div>
<Container service={service}> <Container service={service}>
<Block label="qbittorrent.leech" value={t("common.number", { value: leech })} /> <Block label="qbittorrent.leech" value={t("common.number", { value: leech })} />
<Block label="qbittorrent.download" value={t("common.byterate", { value: rateDl, decimals: 1 })} /> <Block label="qbittorrent.download" value={t("common.byterate", { value: rateDl, decimals: 1 })} />
@ -148,9 +148,9 @@ export default function Component({ service }) {
</Container> </Container>
<div className={torrentsEnabled ? "flex flex-col w-full p-1" : "hidden"}> <div className={torrentsEnabled ? "flex flex-col w-full p-1" : "hidden"}>
{torrentData.map((torrent) => ( {torrentData.map((torrent) => (
<TorrentEntry key={torrent.Id} torrent={torrent} /> <TorrentEntry key={torrent.name + torrent.added_on} torrent={torrent} />
))} ))}
</div> </div>
</> </div>
); );
} }