-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CP Staging] Fix company website field is blank on confirmation page if it is not modified #48731
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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'; | ||
|
@@ -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'; | ||
|
@@ -58,6 +59,10 @@ function WebsiteBusiness({reimbursementAccount, user, session, onNext, isEditing | |
shouldSaveDraft: isEditing, | ||
}); | ||
|
||
useEffect(() => { | ||
BankAccounts.addBusinessWebsiteForDraft(defaultCompanyWebsite); | ||
}, [defaultCompanyWebsite]); | ||
|
||
Comment on lines
+62
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
return ( | ||
<FormProvider | ||
formID={ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NikkiWines hey sorry, I forgot to add back this logic in #48520 which I mentioned in the plan here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah from here? I had forgotten as well, thanks for catching it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I forgot to put the link. Yes, that's the one.