From 2f7880a697cec4cb7107704d46d88e0d6484d5af Mon Sep 17 00:00:00 2001 From: infiinte-persistence Date: Wed, 17 Feb 2021 13:55:38 +0800 Subject: [PATCH] Remove 'Copy' from Claim context-menu; Do nothing when menu is blank. 'Copy' is always disabled for the case of Claim previews since no text is selected. User cannot select text anyway since a left-up event would invoke the Claim's `click` event. 'Copy' is there simply because of re-using `openContextMenu`. --- ui/util/context-menu.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/util/context-menu.js b/ui/util/context-menu.js index eeccb862e..237ca6fdc 100644 --- a/ui/util/context-menu.js +++ b/ui/util/context-menu.js @@ -119,7 +119,11 @@ export function openClaimPreviewMenu(claim, event) { }); } - openContextMenu(event, templates); + injectDevelopmentTemplate(event, templates); + + if (templates.length !== 0) { + remote.Menu.buildFromTemplate(templates).popup({}); + } } // Block context menu