Skip to content

Commit

Permalink
[FE] FIX: 3층 비밀번호 확인 모달을 통해서 반납 시에도 버튼을 누르면 response 가 올 때까지 버튼을 disa…
Browse files Browse the repository at this point in the history
…ble 해 추가 request 를 보내지 못하게 수정 #1315
  • Loading branch information
junyoung2015 committed Aug 25, 2023
1 parent 7638485 commit 3783d1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const PasswordCheckModalContainer: React.FC<{
const currentCabinetId = useRecoilValue(currentCabinetIdState);
const [modalTitle, setModalTitle] = useState<string>("");
const [password, setPassword] = useState("");
const [isLoading, setIsLoading] = useState<boolean>(false);
const [myInfo, setMyInfo] = useRecoilState(userState);
const setTargetCabinetInfo = useSetRecoilState(targetCabinetInfoState);
const setIsCurrentSectionRender = useSetRecoilState(
Expand All @@ -50,6 +51,7 @@ const PasswordCheckModalContainer: React.FC<{
};

const onSendPassword = async () => {
setIsLoading(true);
try {
await axiosSendCabinetPassword(password);
//userCabinetId 세팅
Expand All @@ -73,6 +75,7 @@ const PasswordCheckModalContainer: React.FC<{
setModalTitle(error.response.data.message);
throw error;
} finally {
setIsLoading(false);
setShowResponseModal(true);
}
};
Expand All @@ -89,6 +92,7 @@ const PasswordCheckModalContainer: React.FC<{
<PasswordContainer onChange={onChange} password={password} />
),
closeModal: props.onClose,
isLoading: isLoading,
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const PasswordCheckModal: React.FC<{
onClickProceed,
cancelBtnText,
closeModal,
isLoading,
} = modalContents;
const { isMultiSelect, closeMultiSelectMode } = useMultiSelect();

Expand Down Expand Up @@ -53,7 +54,7 @@ const PasswordCheckModal: React.FC<{
}}
text={proceedBtnText || "확인"}
theme="fill"
disabled={password.length < 4}
disabled={password.length < 4 || isLoading}
/>
</ButtonWrapperStyled>
</ModalStyled>
Expand Down

0 comments on commit 3783d1f

Please sign in to comment.