Skip to content

Commit

Permalink
Merge pull request #48731 from bernhardoj/fix/48674-default-website-i…
Browse files Browse the repository at this point in the history
…sn't-saved-to-draft

[CP Staging] Fix company website field is blank on confirmation page if it is not modified
  • Loading branch information
mountiny authored Sep 9, 2024
2 parents ae47166 + 2310966 commit 41707cb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useMemo} from 'react';
import React, {useCallback, useEffect, useMemo} from 'react';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import FormProvider from '@components/Form/FormProvider';
Expand All @@ -12,6 +12,7 @@ import type {SubStepProps} from '@hooks/useSubStep/types';
import useThemeStyles from '@hooks/useThemeStyles';
import {getDefaultCompanyWebsite} from '@libs/BankAccountUtils';
import * as ValidationUtils from '@libs/ValidationUtils';
import * as BankAccounts from '@userActions/BankAccounts';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import INPUT_IDS from '@src/types/form/ReimbursementAccountForm';
Expand Down Expand Up @@ -58,6 +59,10 @@ function WebsiteBusiness({reimbursementAccount, user, session, onNext, isEditing
shouldSaveDraft: isEditing,
});

useEffect(() => {
BankAccounts.addBusinessWebsiteForDraft(defaultCompanyWebsite);
}, [defaultCompanyWebsite]);

return (
<FormProvider
formID={ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM}
Expand Down

0 comments on commit 41707cb

Please sign in to comment.