Skip to content

Commit

Permalink
Fix: When removing one or more selected torrents without deleting the…
Browse files Browse the repository at this point in the history
…ir data, make sure to only send torrentIds, not full torrent objects, via RPC (#2040)

Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 25, 2021
1 parent a1c5a21 commit c42e05b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
12 changes: 2 additions & 10 deletions web/src/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,10 @@ export class Remote {
);
}

removeTorrents(torrent_ids, callback, context) {
this.sendTorrentActionRequests(
'torrent-remove',
torrent_ids,
callback,
context
);
}
removeTorrentsAndData(torrents) {
removeTorrents(torrents, trash) {
const o = {
arguments: {
'delete-local-data': true,
'delete-local-data': trash,
ids: [],
},
method: 'torrent-remove',
Expand Down
6 changes: 1 addition & 5 deletions web/src/remove-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ export class RemoveDialog extends EventTarget {
_onConfirm() {
const { remote, torrents, trash } = this.options;
if (torrents.length > 0) {
if (trash) {
remote.removeTorrentsAndData(torrents);
} else {
remote.removeTorrents(torrents);
}
remote.removeTorrents(torrents, trash);
}

this.close();
Expand Down

0 comments on commit c42e05b

Please sign in to comment.