diff --git a/client/source/scripts/util/torrentStatusIcons.js b/client/source/scripts/util/torrentStatusIcons.js index f26110f9..570ef498 100644 --- a/client/source/scripts/util/torrentStatusIcons.js +++ b/client/source/scripts/util/torrentStatusIcons.js @@ -16,24 +16,27 @@ const STATUS_ICON_MAP = { export function torrentStatusIcons(status) { let statusString; let statusConditions = { + hashChecking: [status.indexOf(propsMap.clientStatus.checking) > -1], error: [status.indexOf(propsMap.clientStatus.error) > -1], paused: [status.indexOf(propsMap.clientStatus.paused) > -1], stopped: [status.indexOf(propsMap.clientStatus.stopped) > -1], running: [ status.indexOf(propsMap.clientStatus.downloading) > -1, status.indexOf(propsMap.clientStatus.seeding) > -1 - ], - hashChecking: [status.indexOf(propsMap.clientStatus.checking) > -1] + ] }; Object.keys(statusConditions).some((status) => { let conditions = statusConditions[status]; + conditions.some((condition) => { if (condition) { statusString = status; } return condition; }); + + return statusString != null; }); return STATUS_ICON_MAP[statusString];