Skip to content

Build your personal knowledge base with Trilium Notes

fix(breadcrumb): navigation on first level not working

Elian Doranadc356eff338
diff --git a/apps/client/src/widgets/Breadcrumb.tsx b/apps/client/src/widgets/Breadcrumb.tsx
index 3adf46b0aa..945f55e643 100644
--- a/apps/client/src/widgets/Breadcrumb.tsx
+++ b/apps/client/src/widgets/Breadcrumb.tsx
@@ -47,7 +47,7 @@ function BreadcrumbSeparator({ notePath, noteContext }: { notePath: string, note
function BreadcrumbSeparatorDropdownContent({ notePath, noteContext }: { notePath: string, noteContext: NoteContext | undefined }) {
const notePathComponents = notePath.split("/");
- const parentNoteId = notePathComponents.pop();
+ const parentNoteId = notePathComponents.length > 1 ? notePathComponents.pop() : "root";
const childNotes = useChildNotes(parentNoteId);
const notePathPrefix = notePathComponents.join("/"); // last item was removed already.