Skip to content

Commit

Permalink
fix(download): crash on download page click in some cases #34
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Jun 18, 2018
1 parent 3930576 commit 3f4812e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/download-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} />
Expand Down
5 changes: 4 additions & 1 deletion src/app/torrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/background/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ module.exports = async ({
torrentClient.remove(id, (err) => {
if(err)
{
console.log('download removing error', err)
if(callback)
callback(false)
return
Expand Down

0 comments on commit 3f4812e

Please sign in to comment.