Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(tree_context_menu): disable "Convert to attachment" if no eligible notes
Elian Doran5fd488e21072
diff --git a/apps/client/src/menus/tree_context_menu.ts b/apps/client/src/menus/tree_context_menu.tsindex 901a165591..51f9912b32 100644--- a/apps/client/src/menus/tree_context_menu.ts+++ b/apps/client/src/menus/tree_context_menu.ts@@ -140,7 +140,13 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<TreeuiIcon: "bx bx-rename",enabled: isNotRoot && parentNotSearch && notOptionsOrHelp},- { title: t("tree-context-menu.convert-to-attachment"), command: "convertNoteToAttachment", uiIcon: "bx bx-paperclip", enabled: isNotRoot && !isHoisted && notOptionsOrHelp },+ {+ title:+ t("tree-context-menu.convert-to-attachment"),+ command: "convertNoteToAttachment",+ uiIcon: "bx bx-paperclip",+ enabled: isNotRoot && !isHoisted && notOptionsOrHelp && selectedNotes.some(note => note.isEligibleForConversionToAttachment())+ },{ kind: "separator" },