Skip to content

Build your personal knowledge base with Trilium Notes

client/tree context menu: improve handling the case when the note color picker is not available

Adorian Doranbeb7d09aeead
diff --git a/apps/client/src/menus/tree_context_menu.ts b/apps/client/src/menus/tree_context_menu.ts
index 19e6f4e169..901a165591 100644
--- a/apps/client/src/menus/tree_context_menu.ts
+++ b/apps/client/src/menus/tree_context_menu.ts
@@ -244,16 +244,12 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
{ kind: "separator"},
- {
+ (notOptionsOrHelp && selectedNotes.length === 1) ? {
kind: "custom",
componentFn: () => {
- if (notOptionsOrHelp && selectedNotes.length === 1) {
- return NoteColorPicker({note});
- } else {
- return null;
- }
+ return NoteColorPicker({note});
}
- },
+ } : null,
{ kind: "separator" },