From 0d17575360a6dd72dc12e788b7c74bc5a95326ce Mon Sep 17 00:00:00 2001 From: ljh0608 Date: Mon, 2 Sep 2024 19:44:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20navigator=20=ED=99=98=EA=B2=BD=20?= =?UTF-8?q?=EC=B2=B4=ED=81=AC=20=ED=9B=84=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/cueCard/CueCard.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/cueCard/CueCard.tsx b/src/pages/cueCard/CueCard.tsx index 8ef194c..2596c61 100644 --- a/src/pages/cueCard/CueCard.tsx +++ b/src/pages/cueCard/CueCard.tsx @@ -26,12 +26,15 @@ function CueCard() { }); } }; - useEffect(() => { const handleBtnText = async () => { - if (navigator.share) { + try { + const canShare = await navigator.share(); + if (canShare !== undefined) { + throw Error; + } setBtnText('링크 공유하기'); - } else { + } catch { setBtnText('링크 복사하기'); } };