From d6cc4bfa9c991f1bdf1e2d91bcdf68ac095cea7e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 15 Dec 2025 08:34:40 +0200 Subject: [PATCH] fix(layout/note_actions): buttons not reacting to mime type changes --- .../src/widgets/ribbon/NoteActionsCustom.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx b/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx index c31014faa..d774e5589 100644 --- a/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx +++ b/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx @@ -113,13 +113,13 @@ function UploadNewRevisionButton({ note, onChange }: NoteActionsCustomInnerProps ); } -function OpenExternallyButton({ note }: NoteActionsCustomInnerProps) { +function OpenExternallyButton({ note, noteMime }: NoteActionsCustomInnerProps) { return ( openNoteExternally(note.noteId, note.mime)} + onClick={() => openNoteExternally(note.noteId, noteMime)} /> ); } @@ -183,8 +183,8 @@ function ToggleReadOnlyButton({ note, viewType, isDefaultViewMode }: NoteActions />; } -function RunActiveNoteButton({ note }: NoteActionsCustomInnerProps) { - const isEnabled = note.mime.startsWith("application/javascript") || note.mime === "text/x-sqlite;schema=trilium"; +function RunActiveNoteButton({ noteMime }: NoteActionsCustomInnerProps) { + const isEnabled = noteMime.startsWith("application/javascript") || noteMime === "text/x-sqlite;schema=trilium"; return isEnabled && ; } -function SaveToNoteButton({ note }: NoteActionsCustomInnerProps) { - const isEnabled = note.mime === "text/x-sqlite;schema=trilium" && note.isHiddenCompletely(); +function SaveToNoteButton({ note, noteMime }: NoteActionsCustomInnerProps) { + const isEnabled = noteMime === "text/x-sqlite;schema=trilium" && note.isHiddenCompletely(); return isEnabled && ; } -function OpenTriliumApiDocsButton({ note }: NoteActionsCustomInnerProps) { - const isEnabled = note.mime.startsWith("application/javascript;env="); +function OpenTriliumApiDocsButton({ noteMime }: NoteActionsCustomInnerProps) { + const isEnabled = noteMime.startsWith("application/javascript;env="); return isEnabled && openInAppHelpFromUrl(note.mime.endsWith("frontend") ? "Q2z6av6JZVWm" : "MEtfsqa5VwNi")} + onClick={() => openInAppHelpFromUrl(noteMime.endsWith("frontend") ? "Q2z6av6JZVWm" : "MEtfsqa5VwNi")} />; }