From 01b55a17f1aafdd8c4312dfb321b6b9caee55259 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 1 Dec 2022 16:53:57 -0800 Subject: [PATCH] fix flood lint --- src/widgets/flood/component.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/widgets/flood/component.jsx b/src/widgets/flood/component.jsx index 0615154f..4676d798 100644 --- a/src/widgets/flood/component.jsx +++ b/src/widgets/flood/component.jsx @@ -31,16 +31,16 @@ export default function Component({ service }) { let completed = 0; let leech = 0; - for (var torrent in torrentData.torrents) { - rateDl += torrentData.torrents[torrent].downRate; - rateUl += torrentData.torrents[torrent].upRate; - if(torrentData.torrents[torrent].status.includes('complete')){ + Object.values(torrentData.torrents).forEach(torrent => { + rateDl += torrent.downRate; + rateUl += torrent.upRate; + if(torrent.status.includes('complete')){ completed += 1; } - if(torrentData.torrents[torrent].status.includes('downloading')){ + if(torrent.status.includes('downloading')){ leech += 1; } - } + }) return (