client/dialogs/note type chooser: fix broken headings regression

This commit is contained in:
Adorian Doran 2025-09-21 10:31:36 +03:00
parent 089ca7fd29
commit 113af940c1

View File

@ -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,7 +102,7 @@ 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