Fix file list enabled/disabled logic

* Files that are either 100% downloaded OR streamble should be enabled
* Disabled files should not be clickable

This fixes both bugs.
This commit is contained in:
DC
2016-04-06 02:38:07 -07:00
parent 5022877b04
commit 28c386d916
2 changed files with 3 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ function dispatcher (...args) {
// Don't click on whatever is below the button // Don't click on whatever is below the button
e.stopPropagation() e.stopPropagation()
// Don't regisiter clicks on disabled buttons // Don't regisiter clicks on disabled buttons
if (e.target.classList.contains('disabled')) return if (e.currentTarget.classList.contains('disabled')) return
_dispatch.apply(null, args) _dispatch.apply(null, args)
} }
} }

View File

@@ -207,10 +207,11 @@ function TorrentList (state) {
// Show a single torrentSummary file in the details view for a single torrent // Show a single torrentSummary file in the details view for a single torrent
function renderFileRow (torrentSummary, file, index) { function renderFileRow (torrentSummary, file, index) {
// First, find out how much of the file we've downloaded // First, find out how much of the file we've downloaded
var isDone = file.numPiecesPresent === file.numPieces var isDone = false
var progress = '' var progress = ''
if (torrentSummary.progress && torrentSummary.progress.files) { if (torrentSummary.progress && torrentSummary.progress.files) {
var fileProg = torrentSummary.progress.files[index] var fileProg = torrentSummary.progress.files[index]
isDone = fileProg.numPiecesPresent === fileProg.numPieces
progress = Math.round(100 * fileProg.numPiecesPresent / fileProg.numPieces) + '%' progress = Math.round(100 * fileProg.numPiecesPresent / fileProg.numPieces) + '%'
} }