Skip to content

Commit

Permalink
fix: 채팅방 개설중 취소 누르면 튕기는버그 수정
Browse files Browse the repository at this point in the history
- window.close()가 호출되고 있었음
- 근데 dev server에서는 이 함수가 호출되지 않았음
- 추가적으로 onCancel 콜백에 cancel 실행하는 부분 수정해줌
  • Loading branch information
Doosies committed Jan 30, 2024
1 parent b95da43 commit 83d3e79
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions frontend/src/business/hooks/useBlocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ export function useBlocker({ when, onConfirm, onCancel }: useBlockerParams) {
onConfirm?.();
});
},
onCancel: ({ close }) => {
onCancel?.();
close();
},
onCancel,
});
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/business/hooks/usePopup/useExitPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Popup from '@components/Popup';

interface openExitPopupParams {
onConfirm: ({ close }: CloseFunc) => void;
onCancel?: ({ close }: CloseFunc) => void;
onCancel?: () => void;
}

export function useExitPopup() {
Expand All @@ -15,7 +15,7 @@ export function useExitPopup() {
<Popup
close={close}
onConfirm={() => onConfirm({ close })}
onCancel={() => onCancel?.({ close })}
onCancel={onCancel}
>
<div className="flex-with-center flex-col gap-16">
<div>나갈거야?</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/business/hooks/usePopup/usePasswordPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function usePasswordPopup() {

open(({ close: closePopup }) => (
<PasswordPopup
close={close}
close={closePopup}
onCancel={onCancel}
onSubmit={password => {
onSubmit?.({ password, closePopup });
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 83d3e79

Please sign in to comment.