mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 16:26:31 +01:00
delete note fixes
This commit is contained in:
@@ -523,7 +523,7 @@ function updateNote(noteId, noteUpdates) {
|
||||
function deleteBranch(branch, deleteId, taskContext) {
|
||||
taskContext.increaseProgressCount();
|
||||
|
||||
if (!branch || branch.isDeleted) {
|
||||
if (!branch) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ function deleteBranch(branch, deleteId, taskContext) {
|
||||
|| branch.noteId === 'root'
|
||||
|| branch.noteId === cls.getHoistedNoteId()) {
|
||||
|
||||
throw new Error("Can't delete root branch/note");
|
||||
throw new Error("Can't delete root or hoisted branch/note");
|
||||
}
|
||||
|
||||
branch.markAsDeleted(deleteId);
|
||||
@@ -546,8 +546,6 @@ function deleteBranch(branch, deleteId, taskContext) {
|
||||
|
||||
// first delete children and then parent - this will show up better in recent changes
|
||||
|
||||
note.markAsDeleted(deleteId);
|
||||
|
||||
log.info("Deleting note " + note.noteId);
|
||||
|
||||
for (const attribute of note.getOwnedAttributes()) {
|
||||
@@ -558,6 +556,8 @@ function deleteBranch(branch, deleteId, taskContext) {
|
||||
relation.markAsDeleted(deleteId);
|
||||
}
|
||||
|
||||
note.markAsDeleted(deleteId);
|
||||
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -874,7 +874,7 @@ module.exports = {
|
||||
scanForLinks,
|
||||
duplicateSubtree,
|
||||
duplicateSubtreeWithoutRoot,
|
||||
getUndeletedParentBranches: getUndeletedParentBranchIds,
|
||||
getUndeletedParentBranchIds,
|
||||
triggerNoteTitleChanged,
|
||||
eraseDeletedNotesNow
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user