mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fixes
This commit is contained in:
parent
7ccbf45569
commit
bdf42749f3
@ -80,7 +80,7 @@ class NoteShort {
|
||||
const branchIdPos = {};
|
||||
|
||||
for (const branchId of Object.values(this.childToBranch)) {
|
||||
branchIdPos[branchId] = this.treeCache.branches[branchId].notePosition;
|
||||
branchIdPos[branchId] = this.treeCache.getBranch(branchId).notePosition;
|
||||
}
|
||||
|
||||
this.children.sort((a, b) => branchIdPos[this.childToBranch[a]] < branchIdPos[this.childToBranch[b]] ? -1 : 1);
|
||||
|
@ -824,6 +824,7 @@ async function checkFolderStatus(node) {
|
||||
|
||||
node.folder = note.type === 'search' || note.getChildNoteIds().length > 0;
|
||||
node.icon = await treeBuilder.getIcon(note);
|
||||
node.extraClasses = await treeBuilder.getExtraClasses(note);
|
||||
node.renderTitle();
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,6 @@ class TreeCache {
|
||||
for (const branchRow of branchRows) {
|
||||
const branch = new Branch(this, branchRow);
|
||||
|
||||
this.addBranch(branch);
|
||||
|
||||
branchesByNotes[branch.noteId] = branchesByNotes[branch.noteId] || [];
|
||||
branchesByNotes[branch.noteId].push(branch);
|
||||
|
||||
@ -79,6 +77,10 @@ class TreeCache {
|
||||
}
|
||||
}
|
||||
|
||||
for (const branch of branchesByNotes[noteId]) {
|
||||
this.addBranch(branch);
|
||||
}
|
||||
|
||||
const note = new NoteShort(this, noteRow, branchesByNotes[noteId]);
|
||||
|
||||
this.notes[note.noteId] = note;
|
||||
@ -102,7 +104,6 @@ class TreeCache {
|
||||
}
|
||||
|
||||
async reloadNotes(noteIds) {
|
||||
// first load the data before clearing the cache
|
||||
const resp = await server.post('tree/load', { noteIds });
|
||||
|
||||
this.addResp(resp.notes, resp.branches);
|
||||
@ -161,8 +162,9 @@ class TreeCache {
|
||||
if (!(branchId in this.branches)) {
|
||||
console.error(`Not existing branch ${branchId}`);
|
||||
}
|
||||
|
||||
return this.branches[branchId];
|
||||
else {
|
||||
return this.branches[branchId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user