mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 19:11:14 +00:00
Switch entirely to fat arrow functions
This commit is contained in:
@@ -7,13 +7,13 @@ export function filterTorrents(torrentList, opts) {
|
||||
if (filter !== 'all') {
|
||||
if (type === 'status') {
|
||||
let statusFilter = statusMap[filter];
|
||||
return torrentList.filter(function(torrent) {
|
||||
return torrentList.filter((torrent) => {
|
||||
if (torrent.status.indexOf(statusFilter) > -1) {
|
||||
return torrent;
|
||||
}
|
||||
});
|
||||
} else if (type === 'tracker') {
|
||||
return torrentList.filter(function(torrent) {
|
||||
return torrentList.filter((torrent) => {
|
||||
if (torrent.trackers.indexOf(filter) > -1) {
|
||||
return torrent;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
const format = {
|
||||
eta: function(eta) {
|
||||
eta: (eta) => {
|
||||
if (eta === 'Infinity') {
|
||||
return '∞';
|
||||
} else if (eta.years > 0) {
|
||||
@@ -68,7 +68,7 @@ const format = {
|
||||
}
|
||||
},
|
||||
|
||||
data: function(bytes, extraUnits, precision = 2) {
|
||||
data: (bytes, extraUnits, precision = 2) => {
|
||||
let kilobyte = 1024,
|
||||
megabyte = kilobyte * 1024,
|
||||
gigabyte = megabyte * 1024,
|
||||
@@ -106,7 +106,7 @@ const format = {
|
||||
};
|
||||
},
|
||||
|
||||
ratio: function(ratio) {
|
||||
ratio: (ratio) => {
|
||||
ratio = ratio / 1000;
|
||||
let precision = 1;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ export function selectTorrents(options) {
|
||||
let lastHashIndex;
|
||||
|
||||
// get the index of the last selected torrent.
|
||||
options.torrentList.some(function(torrent, index) {
|
||||
options.torrentList.some((torrent, index) => {
|
||||
if (torrent.hash === lastHash) {
|
||||
lastHashIndex = index;
|
||||
return true;
|
||||
@@ -16,7 +16,7 @@ export function selectTorrents(options) {
|
||||
});
|
||||
|
||||
// get the index of the newly selected torrent.
|
||||
options.torrentList.some(function(torrent, index) {
|
||||
options.torrentList.some((torrent, index) => {
|
||||
if (torrent.hash === options.hash) {
|
||||
currentHashIndex = index;
|
||||
return true;
|
||||
|
||||
@@ -7,7 +7,7 @@ export function sortTorrents(torrentsHash, sortBy) {
|
||||
let direction = sortBy.direction;
|
||||
let property = sortBy.property;
|
||||
|
||||
torrents.sort(function(a, b) {
|
||||
torrents.sort((a, b) => {
|
||||
let valA = a[property];
|
||||
let valB = b[property];
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import propsMap from '../../../../shared/constants/propsMap';
|
||||
export function torrentStatusClasses(torrent, ...classes) {
|
||||
let additionalClasses = [];
|
||||
|
||||
classes.forEach(function (className) {
|
||||
classes.forEach((className) => {
|
||||
if (className) {
|
||||
additionalClasses.push(className);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user