Skip to content

Commit

Permalink
fix: navigator.share 사용 가능 여부 렌더링 환경에서 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
ljh0608 committed Sep 2, 2024
1 parent 57d942a commit b60d999
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pages/cueCard/CueCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ function CueCard() {

useEffect(() => {
const handleBtnText = async () => {
try {
await navigator.share();
if (navigator.share) {
setBtnText('링크 공유하기');
} catch {
} else {
setBtnText('링크 복사하기');
}
};

handleBtnText();
});
}, []);

return (
<CueCardWrapper>
Expand Down

0 comments on commit b60d999

Please sign in to comment.