client/note color picker menu item: improve the integration with the tree context menu

This commit is contained in:
Adorian Doran 2025-11-18 02:12:41 +02:00
parent 72051c8660
commit e6847355e7

View File

@ -262,7 +262,13 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
{ {
kind: "custom", kind: "custom",
componentFn: () => ColorPickerMenuItem({note}) componentFn: () => {
if (notOptionsOrHelp && selectedNotes.length === 1) {
return ColorPickerMenuItem({note});
} else {
return null;
}
}
}, },
]; ];
return items.filter((row) => row !== null) as MenuItem<TreeCommandNames>[]; return items.filter((row) => row !== null) as MenuItem<TreeCommandNames>[];