diff --git a/renderer/views/torrent-list.js b/renderer/views/torrent-list.js index 90ef21c9..fa739d36 100644 --- a/renderer/views/torrent-list.js +++ b/renderer/views/torrent-list.js @@ -103,20 +103,26 @@ function renderTorrentButtons (torrentSummary, dispatch) {
dispatch('toggleTorrent', torrentSummary)}> + onclick=${(e) => handleButton('toggleTorrent', e)}> ${torrentSummary.status === 'seeding' ? 'file_upload' : 'file_download'} dispatch('openPlayer', torrentSummary)}> + onclick=${(e) => handleButton('openPlayer', e)}> ${torrentSummary.playStatus === 'timeout' ? 'warning' : 'play_arrow'} dispatch('deleteTorrent', torrentSummary)}> + onclick=${(e) => handleButton('deleteTorrent', e)}> close
` + + function handleButton (action, e) { + // Prevent propagation so that we don't select/unselect the torrent + e.stopPropagation() + dispatch(action, torrentSummary) + } } // Show files, per-file download status and play buttons, and so on