mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 10:58:58 +01:00
fix NoteLink component is unable to display path for root note
This commit is contained in:
parent
e6810ef753
commit
02859039ec
@ -150,11 +150,16 @@ async function createLink(notePath: string | undefined, options: CreateLinkOptio
|
||||
$container.append($noteLink);
|
||||
|
||||
if (showNotePath) {
|
||||
let pathSegments: string[];
|
||||
if (notePath == "root") {
|
||||
pathSegments = ["⌂"];
|
||||
} else {
|
||||
const resolvedPathSegments = (await treeService.resolveNotePathToSegments(notePath)) || [];
|
||||
resolvedPathSegments.pop(); // Remove last element
|
||||
|
||||
const resolvedPath = resolvedPathSegments.join("/");
|
||||
const pathSegments = await treeService.getNotePathTitleComponents(resolvedPath);
|
||||
pathSegments = await treeService.getNotePathTitleComponents(resolvedPath);
|
||||
}
|
||||
|
||||
if (pathSegments) {
|
||||
if (pathSegments.length) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user