mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 03:53:37 -06:00
feat(breadcrumb): hide last note
This commit is contained in:
parent
d02ec47d77
commit
43ceb1982d
@ -6,7 +6,6 @@ import { joinElements } from "./react/react_utils";
|
|||||||
export default function Breadcrumb() {
|
export default function Breadcrumb() {
|
||||||
const { noteContext } = useNoteContext();
|
const { noteContext } = useNoteContext();
|
||||||
const notePath = buildNotePaths(noteContext?.notePathArray);
|
const notePath = buildNotePaths(noteContext?.notePathArray);
|
||||||
console.log("Render with ", notePath);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="breadcrumb">
|
<div className="breadcrumb">
|
||||||
@ -28,7 +27,7 @@ function buildNotePaths(notePathArray: string[] | undefined) {
|
|||||||
|
|
||||||
let prefix = "";
|
let prefix = "";
|
||||||
const output: string[] = [];
|
const output: string[] = [];
|
||||||
for (const notePath of notePathArray) {
|
for (const notePath of notePathArray.slice(0, notePathArray.length - 1)) {
|
||||||
output.push(`${prefix}${notePath}`);
|
output.push(`${prefix}${notePath}`);
|
||||||
prefix += `${notePath}/`;
|
prefix += `${notePath}/`;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user