Skip to content

Commit

Permalink
fix: can submit 조건이 잘못됐던 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhokim98 committed Sep 24, 2024
1 parent 6afae59 commit adb9ddc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/hooks/useAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ const useAccount = () => {
};

useEffect(() => {
const existEmptyField = bankName.trim() === '' && accountNumber.trim() === '';
const existEmptyField = bankNameState.trim() === '' || accountNumberState.trim() === '';
const isChanged = bankName !== bankNameState || accountNumber !== accountNumberState;

setCanSubmit(!existEmptyField && isChanged);
}, [bankName, accountNumber, bankNameState, accountNumberState]);
}, [bankNameState, accountNumberState]);

return {
bankName: bankNameState,
Expand Down

0 comments on commit adb9ddc

Please sign in to comment.