From e9d72ebb17346233c677e9392e400bf7e3bed6b9 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 23 Sep 2021 02:56:00 +0200 Subject: [PATCH] fix: resume torrents after deletion (#1974) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: resume torrents after deletion * Update torrent-list-controller.js Co-authored-by: Diego Rodríguez Baquero --- src/renderer/controllers/torrent-list-controller.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderer/controllers/torrent-list-controller.js b/src/renderer/controllers/torrent-list-controller.js index bf374ef0..46c163c7 100644 --- a/src/renderer/controllers/torrent-list-controller.js +++ b/src/renderer/controllers/torrent-list-controller.js @@ -227,6 +227,11 @@ module.exports = class TorrentListController { } deleteAllTorrents (deleteData) { + // Go back to list before the current playing torrent is deleted + if (this.state.location.url() === 'player') { + dispatch('backToList') + } + this.state.saved.torrents.forEach((summary) => deleteTorrentFile(summary, deleteData)) this.state.saved.torrents = []