diff --git a/ts/components/AboutView.tsx b/ts/components/AboutView.tsx index df0fb35f2..05f97a140 100644 --- a/ts/components/AboutView.tsx +++ b/ts/components/AboutView.tsx @@ -72,25 +72,17 @@ export const AboutView = () => { - + https://getsession.org diff --git a/ts/components/SessionQRCode.tsx b/ts/components/SessionQRCode.tsx index edc1e59b5..fdab8d311 100644 --- a/ts/components/SessionQRCode.tsx +++ b/ts/components/SessionQRCode.tsx @@ -58,7 +58,7 @@ export function SessionQRCode(props: SessionQRCodeProps) { const qrCanvasSize = 1000; const canvasLogoSize = logoSize ? (qrCanvasSize * 0.25 * logoSize) / logoSize : 250; - const saveQRCode = async () => { + const saveQRCode = () => { const fileName = `${id}-${new Date().toISOString()}.jpg`; try { if (saveWithTheme) { diff --git a/ts/components/buttons/CopyToClipboardButton.tsx b/ts/components/buttons/CopyToClipboardButton.tsx index fdfa97045..2979b1996 100644 --- a/ts/components/buttons/CopyToClipboardButton.tsx +++ b/ts/components/buttons/CopyToClipboardButton.tsx @@ -8,7 +8,7 @@ import { SessionIconButton } from '../icon'; import { SessionIconButtonProps } from '../icon/SessionIconButton'; type CopyProps = { - copyContent: string; + copyContent?: string; onCopyComplete?: (copiedValue: string | undefined) => void; hotkey?: boolean; }; @@ -22,11 +22,24 @@ export const CopyToClipboardButton = (props: CopyToClipboardButtonProps) => { const [{ value }, copyToClipboard] = useCopyToClipboard(); const onClick = () => { - copyToClipboard(copyContent); - ToastUtils.pushCopiedToClipBoard(); - setCopied(true); - if (onCopyComplete) { - onCopyComplete(value); + try { + if (!copyContent && !text) { + throw Error('Nothing to copy!'); + } + + if (copyContent) { + copyToClipboard(copyContent); + } else if (text) { + copyToClipboard(text); + } + + ToastUtils.pushCopiedToClipBoard(); + setCopied(true); + if (onCopyComplete) { + onCopyComplete(value); + } + } catch (err) { + window.log.error('CopyToClipboard:', err); } }; @@ -51,7 +64,7 @@ export const CopyToClipboardButton = (props: CopyToClipboardButtonProps) => { type CopyToClipboardIconProps = Omit & CopyProps; -export const CopyToClipboardIcon = (props: CopyToClipboardIconProps) => { +export const CopyToClipboardIcon = (props: CopyToClipboardIconProps & { copyContent: string }) => { const { copyContent, onCopyComplete, hotkey = false } = props; const [{ value }, copyToClipboard] = useCopyToClipboard(); diff --git a/ts/components/leftpane/overlay/OverlayClosedGroup.tsx b/ts/components/leftpane/overlay/OverlayClosedGroup.tsx index 782dcf4d6..cda887813 100644 --- a/ts/components/leftpane/overlay/OverlayClosedGroup.tsx +++ b/ts/components/leftpane/overlay/OverlayClosedGroup.tsx @@ -79,7 +79,7 @@ const MemberRow = ( m === memberPubkey)} + isSelected={selectedMemberIds.includes(memberPubkey)} onSelect={addToSelected} onUnselect={removeFromSelected} />