Skip to content

Build your personal knowledge base with Trilium Notes

fix: update pinned FormattingToolbar state when note type changes

SiriusXT71a4601a3c86
diff --git a/apps/client/src/widgets/note_context_aware_widget.ts b/apps/client/src/widgets/note_context_aware_widget.ts
index df04b35b2c..7b317e9ed5 100644
--- a/apps/client/src/widgets/note_context_aware_widget.ts
+++ b/apps/client/src/widgets/note_context_aware_widget.ts
@@ -118,7 +118,7 @@ class NoteContextAwareWidget extends BasicWidget {
}
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChanged">) {
- if (this.isNote(noteId)) {
+ if (this.isNote(noteId)) {console.log(1011111111)
await this.refresh();
}
}
diff --git a/apps/client/src/widgets/ribbon/FormattingToolbar.tsx b/apps/client/src/widgets/ribbon/FormattingToolbar.tsx
index c2afce18f7..d687c82d46 100644
--- a/apps/client/src/widgets/ribbon/FormattingToolbar.tsx
+++ b/apps/client/src/widgets/ribbon/FormattingToolbar.tsx
@@ -124,7 +124,7 @@ function useRenderState(activeNoteContext: NoteContext | undefined, activeNote:
const [ textNoteEditorType ] = useTriliumOption("textNoteEditorType");
const [ state, setState ] = useState("hidden");
- useTriliumEvents([ "newNoteContextCreated", "noteContextRemoved", "readOnlyTemporarilyDisabled" ], () => {
+ useTriliumEvents([ "newNoteContextCreated", "noteContextRemoved", "readOnlyTemporarilyDisabled", "noteTypeMimeChanged" ], () => {
getFormattingToolbarState(activeNoteContext, activeNote, textNoteEditorType).then(setState);
});