Skip to content
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)
}