Disable "Show in Folder/Finder" and "Remove Data File" for unstarted torrents.

Closes #936.
This commit is contained in:
Benjamin Tan
2016-10-06 17:58:53 +08:00
parent 1b466c64e1
commit 382ea3d965

View File

@@ -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)
},
{