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={() => {
|
||||
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) => {
|
||||
return <TorrentLine key={index} torrent={download.torrentObject} download={download} />
|
||||
|
@ -218,7 +218,10 @@ export default class Torrent extends Component {
|
||||
}
|
||||
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
|
||||
if(torrent.good > 0 || torrent.bad > 0)
|
||||
torrentRating = Math.round(rating(torrent.good, torrent.bad) * 100);
|
||||
|
@ -626,6 +626,7 @@ module.exports = async ({
|
||||
torrentClient.remove(id, (err) => {
|
||||
if(err)
|
||||
{
|
||||
console.log('download removing error', err)
|
||||
if(callback)
|
||||
callback(false)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user