Design: don't show 'Paused' on new torrents

This commit is contained in:
DC
2016-09-25 17:33:22 -07:00
parent 1e7e4cafd4
commit a32889291f

View File

@@ -189,7 +189,19 @@ module.exports = class TorrentList extends React.Component {
}
function renderTorrentStatus () {
return (<span>{capitalize(torrentSummary.status)}</span>)
let status
if (torrentSummary.status === 'paused') {
if (!torrentSummary.progress) status = ''
else if (torrentSummary.progress.progress === 1) status = 'Not seeding'
else status = 'Paused'
} else if (torrentSummary.status === 'downloading') {
status = 'Downloading'
} else if (torrentSummary.status === 'seeding') {
status = 'Seeding'
} else { // torrentSummary.status is 'new' or something unexpected
status = ''
}
return (<span>{status}</span>)
}
}
@@ -362,11 +374,6 @@ function stopPropagation (e) {
e.stopPropagation()
}
// Takes "foo bar", returns "Foo bar"
function capitalize (str) {
return str.slice(0, 1).toUpperCase() + str.slice(1)
}
function getErrorMessage (torrentSummary) {
const err = torrentSummary.error
if (err === 'path-missing') {