mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
fix(react/ribbon): note type not always updating
This commit is contained in:
parent
650aa16b89
commit
e08c4515a7
@ -38,7 +38,10 @@ export default function BasicPropertiesTab({ note }: TabContext) {
|
|||||||
function NoteTypeWidget({ note }: { note?: FNote | null }) {
|
function NoteTypeWidget({ note }: { note?: FNote | null }) {
|
||||||
const noteTypes = useMemo(() => NOTE_TYPES.filter((nt) => !nt.reserved && !nt.static), []);
|
const noteTypes = useMemo(() => NOTE_TYPES.filter((nt) => !nt.reserved && !nt.static), []);
|
||||||
const [ codeNotesMimeTypes ] = useTriliumOption("codeNotesMimeTypes");
|
const [ codeNotesMimeTypes ] = useTriliumOption("codeNotesMimeTypes");
|
||||||
const mimeTypes = useMemo(() => mime_types.getMimeTypes().filter(mimeType => mimeType.enabled), [ codeNotesMimeTypes ]);
|
const mimeTypes = useMemo(() => {
|
||||||
|
mime_types.loadMimeTypes();
|
||||||
|
return mime_types.getMimeTypes().filter(mimeType => mimeType.enabled)
|
||||||
|
}, [ codeNotesMimeTypes ]);
|
||||||
const notSelectableNoteTypes = useMemo(() => NOTE_TYPES.filter((nt) => nt.reserved || nt.static).map((nt) => nt.type), []);
|
const notSelectableNoteTypes = useMemo(() => NOTE_TYPES.filter((nt) => nt.reserved || nt.static).map((nt) => nt.type), []);
|
||||||
|
|
||||||
const currentNoteType = useNoteProperty(note, "type") ?? undefined;
|
const currentNoteType = useNoteProperty(note, "type") ?? undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user