don't open partially downloaded files

This commit is contained in:
Mathias Rasmussen
2016-08-23 22:23:43 +02:00
parent 82853aa017
commit 73cdfc6d45
2 changed files with 5 additions and 2 deletions

View File

@@ -322,8 +322,11 @@ module.exports = class TorrentList extends React.Component {
handleClick = dispatcher('playFile', infoHash, index)
} else {
icon = 'description' /* file icon, opens in OS default app */
handleClick = dispatcher('openItem', infoHash, index)
handleClick = isDone
? dispatcher('openItem', infoHash, index)
: (e) => e.stopPropagation() // noop if file is not ready
}
// TODO: add a css 'disabled' class to indicate that a file cannot be opened/streamed
var rowClass = ''
if (!isSelected) rowClass = 'disabled' // File deselected, not being torrented
if (!isDone && !isPlayable) rowClass = 'disabled' // Can't open yet, can't stream