delete notes dialog provides checkbox to switch between delete all clones and normal delete

This commit is contained in:
zadam
2021-03-18 23:42:30 +01:00
parent d62558d97a
commit b38a63d336
4 changed files with 35 additions and 23 deletions

View File

@@ -222,7 +222,7 @@ function eraseDeletedNotesNow() {
}
function getDeleteNotesPreview(req) {
const {branchIdsToDelete} = req.body;
const {branchIdsToDelete, deleteAllClones} = req.body;
const noteIdsToBeDeleted = new Set();
const branchCountToDelete = {}; // noteId => count (integer)
@@ -233,7 +233,7 @@ function getDeleteNotesPreview(req) {
const note = branch.getNote();
if (note.getBranches().length <= branchCountToDelete[branch.branchId]) {
if (deleteAllClones || note.getBranches().length <= branchCountToDelete[branch.branchId]) {
noteIdsToBeDeleted.add(note.noteId);
for (const childBranch of note.getChildBranches()) {