Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to re-download torrent data if missing #1499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/renderer/pages/torrent-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const LinearProgress = require('material-ui/LinearProgress').default

const TorrentSummary = require('../lib/torrent-summary')
const TorrentPlayer = require('../lib/torrent-player')
const { dispatcher } = require('../lib/dispatcher')
const { dispatcher, dispatch } = require('../lib/dispatcher')

module.exports = class TorrentList extends React.Component {
render () {
Expand Down Expand Up @@ -394,10 +394,20 @@ function getErrorMessage (torrentSummary) {
if (err === 'path-missing') {
return (
<span>
Path missing.<br />
Fix and restart the app, or delete the torrent.
Torrent data missing.<br />
Fix or click to
<a onClick={(e) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be button not a

e.stopPropagation()
restartTorrent(torrentSummary)
}}>re-download torrent</a>.
</span>
)
}
return 'Error'
}

function restartTorrent (summary) {
delete summary.path
delete summary.error
Comment on lines +410 to +411
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these needed?

dispatch('startTorrentingSummary', summary.torrentKey)
}