Set confirmTorrentDeletion to checked by default

This commit is contained in:
Carve 2024-10-17 16:08:13 -04:00
parent 8890cc004d
commit f84ec827f0
2 changed files with 20 additions and 20 deletions

View File

@ -743,7 +743,7 @@
deleteVisibleTorrentsFN = function() { deleteVisibleTorrentsFN = function() {
const hashes = torrentsTable.getFilteredTorrentsHashes(selectedStatus, selectedCategory, selectedTag, selectedTracker); const hashes = torrentsTable.getFilteredTorrentsHashes(selectedStatus, selectedCategory, selectedTag, selectedTracker);
if (hashes.length > 0) { if (hashes.length > 0) {
if (window.qBittorrent.Cache.preferences.get().confirm_torrent_deletion) { // if (window.qBittorrent.Cache.preferences.get().confirm_torrent_deletion) {
new MochaUI.Modal({ new MochaUI.Modal({
...window.qBittorrent.Dialog.baseModalOptions, ...window.qBittorrent.Dialog.baseModalOptions,
id: "confirmDeletionPage", id: "confirmDeletionPage",
@ -759,24 +759,24 @@
} }
}); });
} }
else { // else {
new Request({ // new Request({
url: "api/v2/torrents/delete", // url: "api/v2/torrents/delete",
method: "post", // method: "post",
data: { // data: {
hashes: hashes.join("|"), // hashes: hashes.join("|"),
deleteFiles: false, // deleteFiles: false,
}, // },
onSuccess: () => { // onSuccess: () => {
torrentsTable.deselectAll(); // torrentsTable.deselectAll();
updateMainData(); // updateMainData();
updatePropertiesPanel(); // updatePropertiesPanel();
}, // },
onFailure: () => { // onFailure: () => {
alert("Unable to delete torrents."); // alert("Unable to delete torrents.");
} // }
}).send(); // }).send();
} // }
} }
}; };

View File

@ -10,7 +10,7 @@
<fieldset class="settings"> <fieldset class="settings">
<legend>Transfer list</legend> <legend>Transfer list</legend>
<div class="formRow" style="margin-bottom: 3px;" title="Shows a confirmation dialog upon torrent deletion"> <div class="formRow" style="margin-bottom: 3px;" title="Shows a confirmation dialog upon torrent deletion">
<input type="checkbox" id="confirmTorrentDeletion"> <input type="checkbox" id="confirmTorrentDeletion" checked>
<label for="confirmTorrentDeletion">Confirm when deleting torrents</label> <label for="confirmTorrentDeletion">Confirm when deleting torrents</label>
</div> </div>
<div class="formRow" style="margin-bottom: 3px;"> <div class="formRow" style="margin-bottom: 3px;">