From fb33d569ca51565f73521bedff86f50a4054401f Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Thu, 11 Oct 2018 01:10:42 +0200 Subject: [PATCH] add button to re-download torrent data if missing --- src/renderer/pages/torrent-list-page.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/renderer/pages/torrent-list-page.js b/src/renderer/pages/torrent-list-page.js index 2f816e4944..5b401adf4a 100644 --- a/src/renderer/pages/torrent-list-page.js +++ b/src/renderer/pages/torrent-list-page.js @@ -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 () { @@ -394,10 +394,20 @@ function getErrorMessage (torrentSummary) { if (err === 'path-missing') { return ( - Path missing.
- Fix and restart the app, or delete the torrent. + Torrent data missing.
+ Fix or click to + { + e.stopPropagation() + restartTorrent(torrentSummary) + }}>re-download torrent.
) } return 'Error' } + +function restartTorrent (summary) { + delete summary.path + delete summary.error + dispatch('startTorrentingSummary', summary.torrentKey) +}