simplification of tree cache

This commit is contained in:
zadam
2019-10-26 09:51:08 +02:00
parent 22d48b0586
commit ed9ecf2a57
10 changed files with 159 additions and 172 deletions

View File

@@ -59,10 +59,14 @@ async function getNoteTitle(noteId, parentNoteId = null) {
let {title} = note;
if (parentNoteId !== null) {
const branch = await treeCache.getBranchByChildParent(noteId, parentNoteId);
const branchId = note.parentToBranch[parentNoteId];
if (branch && branch.prefix) {
title = branch.prefix + ' - ' + title;
if (branchId) {
const branch = await treeCache.getBranch(branchId);
if (branch && branch.prefix) {
title = branch.prefix + ' - ' + title;
}
}
}