Skip to content

Commit

Permalink
fix: call async func in writeText
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Nov 30, 2024
1 parent 3f8b2de commit 3e7e857
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/features/ProfileShare/ProfileShareBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styles from './ProfileShareBottomSheet.module.css';
import { useMutation } from '@tanstack/react-query';
import { saveSharing } from '../../types';
import toast from 'react-hot-toast';
import { copyLink, createSharedProfileLink } from '../../shared/functions/linkUtil';
import { createSharedProfileLink } from '../../shared/functions/linkUtil';
import { KakaoSdk } from 'src/shared/lib/kakao/KakaoSdk';
import { useCallback } from 'react';

Expand Down Expand Up @@ -35,10 +35,7 @@ export const ProfileShareBottomSheet = ({
}, [infoId, mutateAsync]);

const onClickShareLink = async () => {
const link = await generateLink();
if (!link) return;

await copyLink(link);
await navigator.clipboard.writeText((await generateLink()) ?? '');
toast.success('링크가 복사되었습니다', { icon: null });
};

Expand Down

0 comments on commit 3e7e857

Please sign in to comment.