소스 검색

fix flood lint

Michael Shamoon 2 년 전
부모
커밋
01b55a17f1
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      src/widgets/flood/component.jsx

+ 6 - 6
src/widgets/flood/component.jsx

@@ -31,16 +31,16 @@ export default function Component({ service }) {
   let completed = 0;
   let completed = 0;
   let leech = 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;
       completed += 1;
     }
     }
-    if(torrentData.torrents[torrent].status.includes('downloading')){
+    if(torrent.status.includes('downloading')){
       leech += 1;
       leech += 1;
     }
     }
-  }
+  })
 
 
   return (
   return (
     <Container service={service}>
     <Container service={service}>