mirror of
https://github.com/zoriya/flood.git
synced 2026-05-31 02:15:12 +00:00
Add status torrent count
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user