From b0cc1d7f513db5b4efe4e668bf5c6fe1c81745e4 Mon Sep 17 00:00:00 2001 From: infiinte-persistence Date: Wed, 17 Feb 2021 14:50:43 +0800 Subject: [PATCH] Add context-menu to report claims directly from Preview/Tile --- ui/util/context-menu.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/util/context-menu.js b/ui/util/context-menu.js index 237ca6fdc..41c8ea422 100644 --- a/ui/util/context-menu.js +++ b/ui/util/context-menu.js @@ -1,4 +1,4 @@ -import { clipboard, remote } from 'electron'; +import { clipboard, remote, shell } from 'electron'; import { convertToShareLink } from 'lbry-redux'; const isDev = process.env.NODE_ENV !== 'production'; @@ -111,12 +111,23 @@ export function openClaimPreviewMenu(claim, event) { if (claim) { const shareLink = convertToShareLink(claim.canonical_url || claim.permanent_url); + const claimId = claim.claim_id; + templates.push({ label: 'Copy link', click: () => { clipboard.writeText(shareLink); }, }); + + templates.push({ type: 'separator' }); + + templates.push({ + label: 'Report content', + click: () => { + shell.openExternal(`https://lbry.com/dmca/${claimId}`); + }, + }); } injectDevelopmentTemplate(event, templates);