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 (#7736)
This commit is contained in:
commit
9b1b56a381
@ -150,11 +150,16 @@ async function createLink(notePath: string | undefined, options: CreateLinkOptio
|
|||||||
$container.append($noteLink);
|
$container.append($noteLink);
|
||||||
|
|
||||||
if (showNotePath) {
|
if (showNotePath) {
|
||||||
const resolvedPathSegments = (await treeService.resolveNotePathToSegments(notePath)) || [];
|
let pathSegments: string[];
|
||||||
resolvedPathSegments.pop(); // Remove last element
|
if (notePath == "root") {
|
||||||
|
pathSegments = ["⌂"];
|
||||||
|
} else {
|
||||||
|
const resolvedPathSegments = (await treeService.resolveNotePathToSegments(notePath)) || [];
|
||||||
|
resolvedPathSegments.pop(); // Remove last element
|
||||||
|
|
||||||
const resolvedPath = resolvedPathSegments.join("/");
|
const resolvedPath = resolvedPathSegments.join("/");
|
||||||
const pathSegments = await treeService.getNotePathTitleComponents(resolvedPath);
|
pathSegments = await treeService.getNotePathTitleComponents(resolvedPath);
|
||||||
|
}
|
||||||
|
|
||||||
if (pathSegments) {
|
if (pathSegments) {
|
||||||
if (pathSegments.length) {
|
if (pathSegments.length) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user