mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
client/dialogs/note type chooser: fix broken headings regression
This commit is contained in:
parent
089ca7fd29
commit
113af940c1
@ -37,6 +37,7 @@ export default function NoteTypeChooserDialogComponent() {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
console.log(noteTypes);
|
||||
note_types.getNoteTypeItems().then(noteTypes => {
|
||||
let index = -1;
|
||||
|
||||
@ -44,8 +45,8 @@ export default function NoteTypeChooserDialogComponent() {
|
||||
if ("kind" in item && item.kind === "separator") {
|
||||
index++;
|
||||
return {
|
||||
title: SEPARATOR_TITLE_REPLACEMENTS[index],
|
||||
enabled: false
|
||||
kind: "header",
|
||||
title: SEPARATOR_TITLE_REPLACEMENTS[index]
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,15 +102,15 @@ export default function NoteTypeChooserDialogComponent() {
|
||||
|
||||
const item = _item as MenuCommandItem<TreeCommandNames>;
|
||||
|
||||
if (item.enabled === false) {
|
||||
if ("kind" in item && item.kind === "header") {
|
||||
return <FormListHeader text={item.title} />
|
||||
} else {
|
||||
return <FormListItem
|
||||
value={[ item.type, item.templateNoteId ].join(",") }
|
||||
icon={item.uiIcon}>
|
||||
{item.title}
|
||||
{item.badges && item.badges.map((badge) => <Badge {...badge} />)}
|
||||
</FormListItem>;
|
||||
{item.title}
|
||||
{item.badges && item.badges.map((badge) => <Badge {...badge} />)}
|
||||
</FormListItem>;
|
||||
}
|
||||
})}
|
||||
</FormList>
|
||||
|
Loading…
x
Reference in New Issue
Block a user