Skip to content

Commit

Permalink
fix: use settimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Nov 30, 2024
1 parent 3e7e857 commit cbf744f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/features/ProfileShare/ProfileShareBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ export const ProfileShareBottomSheet = ({
}, [infoId, mutateAsync]);

const onClickShareLink = async () => {
await navigator.clipboard.writeText((await generateLink()) ?? '');
toast.success('링크가 복사되었습니다', { icon: null });
const link = (await generateLink()) ?? '';
setTimeout(() => {
navigator.clipboard.writeText(link).then(() => toast.success('링크가 복사되었습니다', { icon: null }));
}, 0);
};

const onClickShareKakao = async () => {
Expand Down

0 comments on commit cbf744f

Please sign in to comment.