fix(breadcrumb): breadcrumb shown if there are no children

This commit is contained in:
Elian Doran 2025-12-08 21:57:51 +02:00
parent 200fd76929
commit 223ba4643f
No known key found for this signature in database

View File

@ -8,7 +8,7 @@ import { FormListItem } from "./react/FormList";
import NoteContext from "../components/note_context";
export default function Breadcrumb() {
const { noteContext } = useNoteContext();
const { note, noteContext } = useNoteContext();
const notePath = buildNotePaths(noteContext?.notePathArray);
return (
@ -16,7 +16,8 @@ export default function Breadcrumb() {
{notePath.map((item, index) => (
<Fragment key={item}>
<BreadcrumbItem notePath={item} />
<BreadcrumbSeparator notePath={item} activeNotePath={notePath[index+1]} noteContext={noteContext} />
{(index < notePath.length - 1 || note?.hasChildren()) &&
<BreadcrumbSeparator notePath={item} activeNotePath={notePath[index+1]} noteContext={noteContext} />}
</Fragment>
))}
</div>