Skip to content

Commit e4d0ef3

Browse files
committed
fix: Toast 띄워지지 않도록 수정
1 parent 060867c commit e4d0ef3

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/pages/TimetableSharingActivity.tsx

+3-18
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const TimetableSharingActivity: ActivityComponentType<TimetableSharingParams> =
1717
}) => {
1818
const templateRef = useRef<HTMLDivElement>(null);
1919
const [openToast, setOpenToast] = useState(false);
20-
const [toastMessage, setToastMessage] = useState({
20+
const [toastMessage] = useState({
2121
title: '',
2222
description: '',
2323
});
@@ -72,23 +72,8 @@ const TimetableSharingActivity: ActivityComponentType<TimetableSharingParams> =
7272

7373
await navigator.share(shareData);
7474
}
75-
} catch {
76-
navigator.clipboard
77-
.writeText(window.location.href)
78-
.then(() => {
79-
setToastMessage({
80-
title: '링크가 복사되었어요!',
81-
description: '현재 페이지의 URL이 클립보드에 복사되었어요.',
82-
});
83-
setOpenToast(true);
84-
})
85-
.catch(() => {
86-
setToastMessage({
87-
title: '공유하기를 지원하지 않는 환경입니다',
88-
description: '다른 브라우저에서 시도해보세요.',
89-
});
90-
setOpenToast(true);
91-
});
75+
} catch (error) {
76+
console.error('Failed to share template:', error);
9277
}
9378
};
9479

0 commit comments

Comments
 (0)