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