From 8c008e2e3ac5007985fbcc1b885ecb46a6aeb811 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 16 Dec 2025 17:14:43 +0200 Subject: [PATCH] chore(breadcrumb): address requested changes --- apps/client/src/services/link.ts | 2 +- apps/client/src/widgets/layout/Breadcrumb.tsx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/client/src/services/link.ts b/apps/client/src/services/link.ts index 03595920b..b74dd5f7b 100644 --- a/apps/client/src/services/link.ts +++ b/apps/client/src/services/link.ts @@ -335,7 +335,7 @@ export function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent | JQuery.MouseDo window.open(hrefLink, "_blank"); } else { // Enable protocols supported by CKEditor 5 to be clickable. - if (ALLOWED_PROTOCOLS.some((protocol) => hrefLink.toLowerCase().startsWith(`${protocol }:`))) { + if (ALLOWED_PROTOCOLS.some((protocol) => hrefLink.toLowerCase().startsWith(`${protocol}:`))) { if ( utils.isElectron()) { const electron = utils.dynamicRequire("electron"); electron.shell.openExternal(hrefLink); diff --git a/apps/client/src/widgets/layout/Breadcrumb.tsx b/apps/client/src/widgets/layout/Breadcrumb.tsx index d3d790080..350b52999 100644 --- a/apps/client/src/widgets/layout/Breadcrumb.tsx +++ b/apps/client/src/widgets/layout/Breadcrumb.tsx @@ -313,11 +313,11 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) { const note = await branch?.getNote(); if (!note) return; - const notSearch = note?.type !== "search"; - const notOptionsOrHelp = !note?.noteId.startsWith("_options") && !note?.noteId.startsWith("_help"); + const notSearch = note.type !== "search"; + const notOptionsOrHelp = !note.noteId.startsWith("_options") && !note.noteId.startsWith("_help"); const isArchived = note.isArchived; - const isNotRoot = note?.noteId !== "root"; - const isHoisted = note?.noteId === appContext.tabManager.getActiveContext()?.hoistedNoteId; + const isNotRoot = note.noteId !== "root"; + const isHoisted = note.noteId === appContext.tabManager.getActiveContext()?.hoistedNoteId; const parentNote = isNotRoot && branch ? await froca.getNote(branch.parentNoteId) : null; const parentNotSearch = !parentNote || parentNote.type !== "search"; @@ -369,7 +369,7 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) { enabled: isNotRoot && !isHoisted && parentNotSearch && notOptionsOrHelp, handler: () => branches.deleteNotes([ branchId ]) }, - { kind: "separator"}, + { kind: "separator" }, (notOptionsOrHelp ? { kind: "custom", componentFn: () => { @@ -396,7 +396,7 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) { x: e.pageX, y: e.pageY, selectMenuItemHandler: ({ command }) => { - if (link_context_menu.handleLinkContextMenuItem(command, e, note.noteId)) { + if (link_context_menu.handleLinkContextMenuItem(command, e, notePath)) { return; }