fix: clipboard stuff

This commit is contained in:
Thomas Zarebczan 2019-11-02 11:03:21 -04:00 committed by Sean Yesmunt
parent 683f65dd86
commit c2f31568f5
2 changed files with 9 additions and 1 deletions

View file

@ -27,6 +27,14 @@ export const remote = {
export const clipboard = {
readText: () => '',
writeText: text => {
var dummy = document.createElement('textarea');
document.body.appendChild(dummy);
dummy.value = text;
dummy.select();
document.execCommand('copy');
document.body.removeChild(dummy);
},
};
export const ipcRenderer = {};

View file

@ -138,7 +138,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
e.preventDefault();
e.stopPropagation();
if (claim) {
openCopyLinkMenu(convertToShareLink(claim.permanent_url), e);
openCopyLinkMenu(convertToShareLink(claim.canonical_url || claim.permanent_url), e);
}
// @endif
}