From 28c386d9162b3349603ccd26aa7b7d39549cbc06 Mon Sep 17 00:00:00 2001 From: DC Date: Wed, 6 Apr 2016 02:38:07 -0700 Subject: [PATCH] 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. --- renderer/lib/dispatcher.js | 2 +- renderer/views/torrent-list.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/renderer/lib/dispatcher.js b/renderer/lib/dispatcher.js index 843e67d0..ca1890a3 100644 --- a/renderer/lib/dispatcher.js +++ b/renderer/lib/dispatcher.js @@ -24,7 +24,7 @@ function dispatcher (...args) { // Don't click on whatever is below the button e.stopPropagation() // 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) } } diff --git a/renderer/views/torrent-list.js b/renderer/views/torrent-list.js index d2ea67aa..102d78f1 100644 --- a/renderer/views/torrent-list.js +++ b/renderer/views/torrent-list.js @@ -207,10 +207,11 @@ function TorrentList (state) { // Show a single torrentSummary file in the details view for a single torrent function renderFileRow (torrentSummary, file, index) { // First, find out how much of the file we've downloaded - var isDone = file.numPiecesPresent === file.numPieces + var isDone = false var progress = '' if (torrentSummary.progress && torrentSummary.progress.files) { var fileProg = torrentSummary.progress.files[index] + isDone = fileProg.numPiecesPresent === fileProg.numPieces progress = Math.round(100 * fileProg.numPiecesPresent / fileProg.numPieces) + '%' }