From 83d3e792c33f81dace2ebc560bc588d929b7904d Mon Sep 17 00:00:00 2001 From: Song_Minhyung Date: Tue, 30 Jan 2024 21:13:37 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=B1=84=ED=8C=85=EB=B0=A9=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A4=EC=A4=91=20=EC=B7=A8=EC=86=8C=20=EB=88=84=EB=A5=B4?= =?UTF-8?q?=EB=A9=B4=20=ED=8A=95=EA=B8=B0=EB=8A=94=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - window.close()가 호출되고 있었음 - 근데 dev server에서는 이 함수가 호출되지 않았음 - 추가적으로 onCancel 콜백에 cancel 실행하는 부분 수정해줌 --- frontend/src/business/hooks/useBlocker.ts | 5 +---- frontend/src/business/hooks/usePopup/useExitPopup.tsx | 4 ++-- frontend/src/business/hooks/usePopup/usePasswordPopup.tsx | 2 +- frontend/src/components/Popup/Popup.tsx | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/frontend/src/business/hooks/useBlocker.ts b/frontend/src/business/hooks/useBlocker.ts index 5a9fb734..9aeff6fc 100644 --- a/frontend/src/business/hooks/useBlocker.ts +++ b/frontend/src/business/hooks/useBlocker.ts @@ -27,10 +27,7 @@ export function useBlocker({ when, onConfirm, onCancel }: useBlockerParams) { onConfirm?.(); }); }, - onCancel: ({ close }) => { - onCancel?.(); - close(); - }, + onCancel, }); return true; } diff --git a/frontend/src/business/hooks/usePopup/useExitPopup.tsx b/frontend/src/business/hooks/usePopup/useExitPopup.tsx index 0ef5a3c1..11868cca 100644 --- a/frontend/src/business/hooks/usePopup/useExitPopup.tsx +++ b/frontend/src/business/hooks/usePopup/useExitPopup.tsx @@ -4,7 +4,7 @@ import Popup from '@components/Popup'; interface openExitPopupParams { onConfirm: ({ close }: CloseFunc) => void; - onCancel?: ({ close }: CloseFunc) => void; + onCancel?: () => void; } export function useExitPopup() { @@ -15,7 +15,7 @@ export function useExitPopup() { onConfirm({ close })} - onCancel={() => onCancel?.({ close })} + onCancel={onCancel} >
나갈거야?
diff --git a/frontend/src/business/hooks/usePopup/usePasswordPopup.tsx b/frontend/src/business/hooks/usePopup/usePasswordPopup.tsx index c597aa84..8a1af7cb 100644 --- a/frontend/src/business/hooks/usePopup/usePasswordPopup.tsx +++ b/frontend/src/business/hooks/usePopup/usePasswordPopup.tsx @@ -18,7 +18,7 @@ export function usePasswordPopup() { open(({ close: closePopup }) => ( { onSubmit?.({ password, closePopup }); diff --git a/frontend/src/components/Popup/Popup.tsx b/frontend/src/components/Popup/Popup.tsx index 6b5dd3f3..66404739 100644 --- a/frontend/src/components/Popup/Popup.tsx +++ b/frontend/src/components/Popup/Popup.tsx @@ -7,7 +7,7 @@ interface PopupProps { children: React.ReactNode; } -export default function Popup({ onCancel, onConfirm, children }: PopupProps) { +export default function Popup({ close, onCancel, onConfirm, children }: PopupProps) { const closeWithCancel = () => { onCancel?.(); close();