Skip to content

Build your personal knowledge base with Trilium Notes

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

Adorian Dorane6847355e736
diff --git a/apps/client/src/menus/tree_context_menu.ts b/apps/client/src/menus/tree_context_menu.ts
index b4b19cabdf..972f21c117 100644
--- a/apps/client/src/menus/tree_context_menu.ts
+++ b/apps/client/src/menus/tree_context_menu.ts
@@ -262,7 +262,13 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
{
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>[];