Skip to content

Commit 1e02e78

Browse files
committed
add new function
1 parent adfb1cc commit 1e02e78

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/pages/settings/Preferences/PaymentCurrencyPage.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ function PaymentCurrencyPage() {
2121

2222
const paymentCurrency = personalPolicy?.outputCurrency ?? CONST.CURRENCY.USD;
2323

24+
const handleDismissKeyboardAndGoBack = () => {
25+
KeyboardUtils.dismiss().then(() => {
26+
Navigation.goBack();
27+
});
28+
};
29+
2430
return (
2531
<ScreenWrapper
2632
includeSafeAreaPaddingBottom={false}
@@ -31,11 +37,7 @@ function PaymentCurrencyPage() {
3137
<HeaderWithBackButton
3238
title={translate('billingCurrency.paymentCurrency')}
3339
shouldShowBackButton
34-
onBackButtonPress={() => {
35-
KeyboardUtils.dismiss().then(() => {
36-
Navigation.goBack();
37-
});
38-
}}
40+
onBackButtonPress={handleDismissKeyboardAndGoBack}
3941
/>
4042

4143
<Text style={[styles.mh5, styles.mv4]}>{translate('billingCurrency.paymentCurrencyDescription')}</Text>
@@ -47,9 +49,7 @@ function PaymentCurrencyPage() {
4749
if (option.currencyCode !== paymentCurrency) {
4850
updateGeneralSettings(personalPolicyID, personalPolicy?.name ?? '', option.currencyCode);
4951
}
50-
KeyboardUtils.dismiss().then(() => {
51-
Navigation.goBack();
52-
});
52+
handleDismissKeyboardAndGoBack();
5353
}}
5454
initiallySelectedCurrencyCode={paymentCurrency}
5555
didScreenTransitionEnd={didScreenTransitionEnd}

0 commit comments

Comments
 (0)