Compare commits
2 Commits
ae7c752e43
...
93e427fc73
Author | SHA1 | Date | |
---|---|---|---|
93e427fc73 | |||
135ddd0c93 |
@ -16,8 +16,11 @@ export const Progress = ({ torrent }) => {
|
||||
}
|
||||
|
||||
// Pretty sizes
|
||||
const downloadedSize = prettySize(torrent.status.downloaded_size);
|
||||
const totalSize = prettySize(torrent.status.total_size);
|
||||
const downloadedSize =
|
||||
torrent.status.downloaded_size >= torrent.status.total_size
|
||||
? totalSize
|
||||
: prettySize(torrent.status.downloaded_size);
|
||||
const downloadRate = prettySize(torrent.status.download_rate) + "/s";
|
||||
return (
|
||||
<div>
|
||||
|
@ -48,8 +48,10 @@ export default (state = defaultState, action) =>
|
||||
|
||||
case "TORRENTS_FETCH_FULFILLED":
|
||||
draft.fetching = false;
|
||||
draft.torrents = formatTorrents(action.payload.response.data);
|
||||
draft.count = action.payload.response.data.length;
|
||||
if (action.payload.response.data) {
|
||||
draft.torrents = formatTorrents(action.payload.response.data);
|
||||
draft.count = action.payload.response.data.length;
|
||||
}
|
||||
break;
|
||||
|
||||
case "TORRENTS_SEARCH_PENDING":
|
||||
|
Loading…
x
Reference in New Issue
Block a user