mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
not finding node for a note path does not have to be always an error
This commit is contained in:
parent
1aa5349628
commit
0cfd95d9b8
@ -797,10 +797,12 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
|||||||
|
|
||||||
const node = await this.expandToNote(activeContext.notePath);
|
const node = await this.expandToNote(activeContext.notePath);
|
||||||
|
|
||||||
|
if (node) {
|
||||||
await node.makeVisible({scrollIntoView: true});
|
await node.makeVisible({scrollIntoView: true});
|
||||||
node.setActive(true, {noEvents: true, noFocus: false});
|
node.setActive(true, {noEvents: true, noFocus: false});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** @return {FancytreeNode} */
|
/** @return {FancytreeNode} */
|
||||||
async getNodeFromPath(notePath, expand = false, logErrors = true) {
|
async getNodeFromPath(notePath, expand = false, logErrors = true) {
|
||||||
@ -851,8 +853,12 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
|||||||
// these are real notes with real notePath, user can display them in a detail
|
// these are real notes with real notePath, user can display them in a detail
|
||||||
// but they don't have a node in the tree
|
// but they don't have a node in the tree
|
||||||
|
|
||||||
|
const childNote = await treeCache.getNote(childNoteId);
|
||||||
|
|
||||||
|
if (!childNote || childNote.type !== 'image') {
|
||||||
ws.logError(`Can't find node for child node of noteId=${childNoteId} for parent of noteId=${parentNode.data.noteId} and hoistedNoteId=${hoistedNoteService.getHoistedNoteId()}, requested path is ${notePath}`);
|
ws.logError(`Can't find node for child node of noteId=${childNoteId} for parent of noteId=${parentNode.data.noteId} and hoistedNoteId=${hoistedNoteService.getHoistedNoteId()}, requested path is ${notePath}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user