Skip to content

Commit a47f719

Browse files
authored
Merge pull request Expensify#77703 from LorenzoBloedow/fix-bank-us
Fix Puerto Rico, Guam, and U.S. Virgin Islands bank flow
2 parents fd51d25 + f20daa4 commit a47f719

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/CONST/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,9 @@ const CONST = {
731731
CA: 'CA',
732732
GB: 'GB',
733733
IT: 'IT',
734+
PR: 'PR',
735+
GU: 'GU',
736+
VI: 'VI',
734737
},
735738
SWIPE_DIRECTION: {
736739
DOWN: 'down',
@@ -7804,6 +7807,8 @@ const FRAUD_PROTECTION_EVENT = {
78047807
NEW_EMAILS_INVITED: 'NewEmailsInvited',
78057808
};
78067809

7810+
const COUNTRIES_US_BANK_FLOW: string[] = [CONST.COUNTRY.US, CONST.COUNTRY.PR, CONST.COUNTRY.GU, CONST.COUNTRY.VI];
7811+
78077812
type Country = keyof typeof CONST.ALL_COUNTRIES;
78087813

78097814
type IOUType = ValueOf<typeof CONST.IOU.TYPE>;
@@ -7817,6 +7822,6 @@ type CancellationType = ValueOf<typeof CONST.CANCELLATION_TYPE>;
78177822

78187823
export type {Country, IOUAction, IOUType, IOURequestType, SubscriptionType, FeedbackSurveyOptionID, CancellationType, OnboardingInvite, OnboardingAccounting, IOUActionParams};
78197824

7820-
export {CONTINUATION_DETECTION_SEARCH_FILTER_KEYS, TASK_TO_FEATURE, FRAUD_PROTECTION_EVENT};
7825+
export {CONTINUATION_DETECTION_SEARCH_FILTER_KEYS, TASK_TO_FEATURE, FRAUD_PROTECTION_EVENT, COUNTRIES_US_BANK_FLOW};
78217826

78227827
export default CONST;

src/pages/settings/Wallet/InternationalDepositAccount/substeps/CountrySelection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import StringUtils from '@libs/StringUtils';
1515
import type CustomSubStepProps from '@pages/settings/Wallet/InternationalDepositAccount/types';
1616
import {fetchCorpayFields} from '@userActions/BankAccounts';
1717
import Text from '@src/components/Text';
18-
import CONST from '@src/CONST';
18+
import CONST, {COUNTRIES_US_BANK_FLOW} from '@src/CONST';
1919
import type {TranslationPaths} from '@src/languages/types';
2020
import ONYXKEYS from '@src/ONYXKEYS';
2121
import ROUTES from '@src/ROUTES';
@@ -30,7 +30,7 @@ function CountrySelection({isEditing, onNext, formValues, resetScreenIndex, fiel
3030
const [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isUserValidatedSelector, canBeMissing: false});
3131

3232
const onCountrySelected = useCallback(() => {
33-
if (currentCountry === CONST.COUNTRY.US) {
33+
if (COUNTRIES_US_BANK_FLOW.includes(currentCountry)) {
3434
if (isUserValidated) {
3535
Navigation.navigate(ROUTES.SETTINGS_ADD_US_BANK_ACCOUNT);
3636
} else {

0 commit comments

Comments
 (0)