fix "root" note in edited notes, closes #2058

This commit is contained in:
zadam 2021-07-08 13:06:22 +02:00
parent 65938c5272
commit a6bef45a30

View file

@ -171,11 +171,20 @@ function getNotePath(noteId) {
if (retPath) {
const noteTitle = getNoteTitleForPath(retPath);
let branchId;
if (note.noteId === 'root') {
branchId = 'root';
}
else {
const parentNote = note.parents[0];
branchId = noteCache.getBranch(noteId, parentNote.noteId).branchId;
}
return {
noteId: noteId,
branchId: noteCache.getBranch(noteId, parentNote.noteId).branchId,
branchId: branchId,
title: noteTitle,
notePath: retPath,
path: retPath.join('/')