Skip to content

Commit

Permalink
feat:넷플릭스로 이동 누르고 1초 뒤 페이지 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
gogumalatte committed Nov 25, 2024
1 parent bb39668 commit b2e2b1a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Main/components/DetailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const DetailModal = ({ isOpen, onClose, content }: DetailModalProps) => {
try {
await api.post(`/api/watch/${content.id}`);
toast({
duration: 3000,
duration: 1500,
isClosable: true,
position: "top",
render: () => (
Expand All @@ -97,14 +97,16 @@ const DetailModal = ({ isOpen, onClose, content }: DetailModalProps) => {
</Box>
),
});
// 1초 뒤에 페이지 이동
setTimeout(() => {
window.open(
"https://www.netflix.com/kr/",
"_blank",
"noopener,noreferrer"
);
}, 1000);
} catch (error) {
console.error("시청 기록 저장 요청 중 오류 발생:", error);
} finally {
window.open(
"https://www.netflix.com/kr/",
"_blank",
"noopener,noreferrer"
);
}
};

Expand Down

0 comments on commit b2e2b1a

Please sign in to comment.