diff --git a/apps/client/src/widgets/Breadcrumb.tsx b/apps/client/src/widgets/Breadcrumb.tsx index 3adf46b0a..945f55e64 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.