mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 01:36:24 +01:00
delete notes are now in cache as well which allows simplified update of the tree after deletion
This commit is contained in:
@@ -77,11 +77,11 @@ class TreeCache {
|
||||
}
|
||||
}
|
||||
|
||||
for (const branch of branchesByNotes[noteId]) {
|
||||
for (const branch of branchesByNotes[noteId] || []) { // can be empty for deleted notes
|
||||
this.addBranch(branch);
|
||||
}
|
||||
|
||||
const note = new NoteShort(this, noteRow, branchesByNotes[noteId]);
|
||||
const note = new NoteShort(this, noteRow, branchesByNotes[noteId] || []);
|
||||
|
||||
this.notes[note.noteId] = note;
|
||||
|
||||
@@ -158,9 +158,11 @@ class TreeCache {
|
||||
}
|
||||
|
||||
/** @return {Branch} */
|
||||
getBranch(branchId) {
|
||||
getBranch(branchId, silentNotFoundError = false) {
|
||||
if (!(branchId in this.branches)) {
|
||||
console.error(`Not existing branch ${branchId}`);
|
||||
if (!silentNotFoundError) {
|
||||
console.error(`Not existing branch ${branchId}`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return this.branches[branchId];
|
||||
|
||||
Reference in New Issue
Block a user