Add status torrent count

This commit is contained in:
John Furrow
2016-02-06 01:22:28 -08:00
parent ae0b644d8d
commit c2216a97e8
20 changed files with 256 additions and 163 deletions
+7 -2
View File
@@ -1,10 +1,15 @@
import propsMaps from '../../../../shared/constants/propsMap';
export function filterTorrents(torrentList, filterBy) {
let statusMap = propsMaps.clientStatus;
if (filterBy !== 'all') {
torrentList = torrentList.filter(torrent => {
if (torrent.status.indexOf('is-' + filterBy) > -1) {
torrentList = torrentList.filter((torrent) => {
if (torrent.status.indexOf(statusMap[filterBy]) > -1) {
return torrent;
}
});
}
return torrentList;
}