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(markdown): inline title not changing when switching MIME type
Elian Doranb1565956939c
diff --git a/apps/client/src/widgets/layout/InlineTitle.tsx b/apps/client/src/widgets/layout/InlineTitle.tsxindex d4e2602f9e..8502ac3d48 100644--- a/apps/client/src/widgets/layout/InlineTitle.tsx+++ b/apps/client/src/widgets/layout/InlineTitle.tsx@@ -24,13 +24,14 @@ const supportedNoteTypes = new Set<NoteType>([export default function InlineTitle() {const { note, parentComponent, viewScope } = useNoteContext();const type = useNoteProperty(note, "type");+ const mime = useNoteProperty(note, "mime");const [ shown, setShown ] = useState(shouldShow(note, type, viewScope));const containerRef = useRef<HTMLDivElement>(null);const [ titleHidden, setTitleHidden ] = useState(false);useLayoutEffect(() => {setShown(shouldShow(note, type, viewScope));- }, [ note, type, viewScope ]);+ }, [ note, type, mime, viewScope ]);useLayoutEffect(() => {if (!shown) return;