diff --git a/apps/client/src/widgets/layout/Breadcrumb.tsx b/apps/client/src/widgets/layout/Breadcrumb.tsx index 511ed2de0..a814fb13a 100644 --- a/apps/client/src/widgets/layout/Breadcrumb.tsx +++ b/apps/client/src/widgets/layout/Breadcrumb.tsx @@ -241,7 +241,7 @@ function buildNotePaths(noteContext: NoteContext) { } // When hoisted, display only the path starting with the hoisted note. - if (noteContext.hoistedNoteId !== "root") { + if (noteContext.hoistedNoteId !== "root" && hoistedNotePos > -1) { output = output.slice(hoistedNotePos); } diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx index 535a797f5..d01fb8156 100644 --- a/apps/client/src/widgets/react/hooks.tsx +++ b/apps/client/src/widgets/react/hooks.tsx @@ -267,7 +267,7 @@ export function useTriliumOptions(...names: T[]) { * @returns a name with the given prefix and a random alpanumeric string appended to it. */ export function useUniqueName(prefix?: string) { - return useMemo(() => (prefix ? `${prefix }-` : "") + utils.randomString(10), [ prefix ]); + return useMemo(() => (prefix ? `${prefix}-` : "") + utils.randomString(10), [ prefix ]); } export function useNoteContext() {