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:
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) + '%'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user