Skip to content

Commit

Permalink
fix: initial substep fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMuzyk committed Nov 7, 2023
1 parent 5e1c05d commit 47553da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/ReimbursementAccount/PersonalInfo/PersonalInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ const bodyContent = [FullName, DateOfBirth, SocialSecurityNumber, Address, Confi
function PersonalInfo({reimbursementAccount, reimbursementAccountDraft}) {
const {translate} = useLocalize();

const submit = useCallback(() => {
const values = getPersonalInfoValues(reimbursementAccountDraft, reimbursementAccount);
const values = useMemo(() => getPersonalInfoValues(reimbursementAccountDraft, reimbursementAccount), [reimbursementAccount, reimbursementAccountDraft]);

const submit = useCallback(() => {
const payload = {
bankAccountID: _.get(reimbursementAccount, 'achData.bankAccountID', 0),
...values,
};

BankAccounts.updatePersonalInformationForBankAccount(payload);
}, [reimbursementAccount, reimbursementAccountDraft]);
const startFrom = useMemo(() => getInitialSubstepForPersonalInfo(reimbursementAccountDraft), [reimbursementAccountDraft]);
}, [reimbursementAccount, values]);
const startFrom = useMemo(() => getInitialSubstepForPersonalInfo(values), [values]);

const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo} = useSubStep({bodyContent, startFrom, onFinished: submit});

Expand Down

0 comments on commit 47553da

Please sign in to comment.