Add context-menu to report claims directly from Preview/Tile
This commit is contained in:
parent
2f7880a697
commit
b0cc1d7f51
1 changed files with 12 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { clipboard, remote } from 'electron';
|
import { clipboard, remote, shell } from 'electron';
|
||||||
import { convertToShareLink } from 'lbry-redux';
|
import { convertToShareLink } from 'lbry-redux';
|
||||||
const isDev = process.env.NODE_ENV !== 'production';
|
const isDev = process.env.NODE_ENV !== 'production';
|
||||||
|
|
||||||
|
@ -111,12 +111,23 @@ export function openClaimPreviewMenu(claim, event) {
|
||||||
|
|
||||||
if (claim) {
|
if (claim) {
|
||||||
const shareLink = convertToShareLink(claim.canonical_url || claim.permanent_url);
|
const shareLink = convertToShareLink(claim.canonical_url || claim.permanent_url);
|
||||||
|
const claimId = claim.claim_id;
|
||||||
|
|
||||||
templates.push({
|
templates.push({
|
||||||
label: 'Copy link',
|
label: 'Copy link',
|
||||||
click: () => {
|
click: () => {
|
||||||
clipboard.writeText(shareLink);
|
clipboard.writeText(shareLink);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
templates.push({ type: 'separator' });
|
||||||
|
|
||||||
|
templates.push({
|
||||||
|
label: 'Report content',
|
||||||
|
click: () => {
|
||||||
|
shell.openExternal(`https://lbry.com/dmca/${claimId}`);
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
injectDevelopmentTemplate(event, templates);
|
injectDevelopmentTemplate(event, templates);
|
||||||
|
|
Loading…
Reference in a new issue