From 382ea3d9657586a1f67daa2f60cc0899b0d2ef32 Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Thu, 6 Oct 2016 17:58:53 +0800 Subject: [PATCH] Disable "Show in Folder/Finder" and "Remove Data File" for unstarted torrents. Closes #936. --- src/renderer/controllers/torrent-list-controller.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/renderer/controllers/torrent-list-controller.js b/src/renderer/controllers/torrent-list-controller.js index 23e7584d..432827dc 100644 --- a/src/renderer/controllers/torrent-list-controller.js +++ b/src/renderer/controllers/torrent-list-controller.js @@ -182,6 +182,7 @@ module.exports = class TorrentListController { openTorrentContextMenu (infoHash) { const torrentSummary = TorrentSummary.getByKey(this.state, infoHash) + const torrentStarted = !!(torrentSummary.files && torrentSummary.progress) const menuTemplate = [ { @@ -190,6 +191,7 @@ module.exports = class TorrentListController { }, { label: 'Remove Data File', + enabled: torrentStarted, click: () => dispatch('confirmDeleteTorrent', torrentSummary.infoHash, true) }, { @@ -197,6 +199,7 @@ module.exports = class TorrentListController { }, { label: process.platform === 'darwin' ? 'Show in Finder' : 'Show in Folder', + enabled: torrentStarted, click: () => showItemInFolder(torrentSummary) }, {