Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
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.tsindex 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.tsxindex 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);});