Avoid clipboard error on Safari for iOS
This commit is contained in:
parent
684a4cb19a
commit
e18ff8debb
@ -47,7 +47,7 @@ const ClientTile: React.FC<IProps> = ({ client, link }: IProps) => {
|
||||
if (copyString !== '') {
|
||||
inviteButton = (
|
||||
<Button
|
||||
onClick={() => navigator.clipboard.writeText(copyString)}
|
||||
onClick={() => navigator.clipboard?.writeText(copyString)}
|
||||
flashChildren="Invite copied"
|
||||
>
|
||||
Copy invite
|
||||
|
@ -134,7 +134,7 @@ const LinkCreatedTile: React.FC<ILinkCreatedTileProps> = (props) => {
|
||||
icon={copyIcon}
|
||||
flashIcon={tickIcon}
|
||||
onClick={(): void => {
|
||||
navigator.clipboard.writeText(props.link);
|
||||
navigator.clipboard?.writeText(props.link);
|
||||
}}
|
||||
ref={buttonRef}
|
||||
>
|
||||
|
@ -58,7 +58,7 @@ const InviteTile: React.FC<IProps> = ({ children, client, link }: IProps) => {
|
||||
case ClientKind.TEXT_CLIENT:
|
||||
// TODO: copy to clipboard
|
||||
invite = <p>{client.toInviteString(link)}</p>;
|
||||
navigator.clipboard.writeText(client.copyString(link));
|
||||
navigator.clipboard?.writeText(client.copyString(link));
|
||||
inviteUseString = `These are instructions for ${client.name}.`;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user