Skip to content

Commit

Permalink
fix: navigator 환경 체크 후 텍스트 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ljh0608 committed Sep 2, 2024
1 parent b60d999 commit 0d17575
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pages/cueCard/CueCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('링크 복사하기');
}
};
Expand Down

0 comments on commit 0d17575

Please sign in to comment.