Skip to content

Commit 310d720

Browse files
authored
Merge pull request Expensify#67391 from allgandalf/fix/65760
fix screen transition issue on payment currency selector
2 parents 28a0bce + cb94bc4 commit 310d720

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/components/CurrencySelectionList/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function CurrencySelectionList({
1515
searchInputLabel,
1616
initiallySelectedCurrencyCode,
1717
onSelect,
18+
didScreenTransitionEnd = true,
1819
selectedCurrencies = [],
1920
canSelectMultiple = false,
2021
recentlyUsedCurrencies,
@@ -109,6 +110,7 @@ function CurrencySelectionList({
109110
initiallyFocusedOptionKey={initiallySelectedCurrencyCode}
110111
showScrollIndicator
111112
canSelectMultiple={canSelectMultiple}
113+
showLoadingPlaceholder={!didScreenTransitionEnd}
112114
/>
113115
);
114116
}

src/components/CurrencySelectionList/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ type CurrencySelectionListProps = Partial<SelectionListProps<CurrencyListItem>>
2626

2727
/** List of excluded currency codes */
2828
excludedCurrencies?: string[];
29+
30+
/** Whether the screen transition has ended */
31+
didScreenTransitionEnd?: boolean;
2932
};
3033

3134
export type {CurrencyListItem, CurrencySelectionListProps};

src/pages/settings/Preferences/PaymentCurrencyPage.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ function PaymentCurrencyPage() {
3939
recentlyUsedCurrencies={[]}
4040
searchInputLabel={translate('common.search')}
4141
onSelect={(option: CurrencyListItem) => {
42-
if (!didScreenTransitionEnd) {
43-
return;
44-
}
4542
if (option.currencyCode !== paymentCurrency) {
4643
updateGeneralSettings(personalPolicyID, personalPolicy?.name ?? '', option.currencyCode);
4744
}
4845
Navigation.goBack();
4946
}}
5047
initiallySelectedCurrencyCode={paymentCurrency}
48+
didScreenTransitionEnd={didScreenTransitionEnd}
5149
/>
5250
</>
5351
)}

0 commit comments

Comments
 (0)