From dda786ce7ae07d23fde164e60e93df4c319f45f8 Mon Sep 17 00:00:00 2001 From: Wren Hawthorne Date: Sun, 14 Jul 2024 20:50:36 -0700 Subject: [PATCH] Try to fix share --- src/components/ShareStep.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/ShareStep.tsx b/src/components/ShareStep.tsx index f2d0687..09ddc5e 100644 --- a/src/components/ShareStep.tsx +++ b/src/components/ShareStep.tsx @@ -52,17 +52,16 @@ export const ShareStep = (props: ShareStepProps) => { variant="success" style={{ justifySelf: 'center' }} onClick={async () => { - if (navigator?.canShare?.()) { - await navigator.share({ - url: shareUrl, - text: "Check out my song!", - title - }) + const shareData = { + url: shareUrl, + text: "Check out my song!", + title + } + if (navigator?.canShare?.(shareData)) { + await navigator.share() } else { - console.log(shareUrl) navigator.clipboard.writeText(shareUrl) } - }}> Share