fix(download): crash on download page click in some cases #34
This commit is contained in:
parent
9adebf8d4d
commit
44efa6138e
@ -43,7 +43,7 @@ export default class TopPage extends Page {
|
|||||||
<RaisedButton label={__('Back to main page')} primary={true} onClick={() => {
|
<RaisedButton label={__('Back to main page')} primary={true} onClick={() => {
|
||||||
window.router('/')
|
window.router('/')
|
||||||
}} />
|
}} />
|
||||||
<List style={{paddingBottom: '70px'}} className='animated recent-torrents'>
|
<List style={{paddingBottom: '70px', minWidth: '60%'}} className='animated recent-torrents'>
|
||||||
{
|
{
|
||||||
this.downloads.map((download, index) => {
|
this.downloads.map((download, index) => {
|
||||||
return <TorrentLine key={index} torrent={download.torrentObject} download={download} />
|
return <TorrentLine key={index} torrent={download.torrentObject} download={download} />
|
||||||
|
@ -219,6 +219,9 @@ export default class Torrent extends Component {
|
|||||||
render()
|
render()
|
||||||
{
|
{
|
||||||
const torrent = this.props.torrent;
|
const torrent = this.props.torrent;
|
||||||
|
if(!torrent)
|
||||||
|
return null // can try draw null torrent (for example on downloading not started)
|
||||||
|
|
||||||
let torrentRating = -1
|
let torrentRating = -1
|
||||||
if(torrent.good > 0 || torrent.bad > 0)
|
if(torrent.good > 0 || torrent.bad > 0)
|
||||||
torrentRating = Math.round(rating(torrent.good, torrent.bad) * 100);
|
torrentRating = Math.round(rating(torrent.good, torrent.bad) * 100);
|
||||||
|
@ -626,6 +626,7 @@ module.exports = async ({
|
|||||||
torrentClient.remove(id, (err) => {
|
torrentClient.remove(id, (err) => {
|
||||||
if(err)
|
if(err)
|
||||||
{
|
{
|
||||||
|
console.log('download removing error', err)
|
||||||
if(callback)
|
if(callback)
|
||||||
callback(false)
|
callback(false)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user