-
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
Ask non-USD Workspaces to update currency before adding VBBA #19638
Changes from all commits
109421e
dfd7ab4
4ed31b8
742936a
852597f
ea7b72b
cac93b3
d408b8c
6e3b32c
f091adf
c31bed2
f5fe5f9
339785a
d9d0f0b
0b49f6c
e8af5b0
1841745
23e5c97
96dee89
7ed5494
d3d6256
e3bc7d9
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 |
---|---|---|
|
@@ -343,35 +343,40 @@ class ReimbursementAccountPage extends React.Component { | |
); | ||
} | ||
|
||
let errorComponent; | ||
const userHasPhonePrimaryEmail = Str.endsWith(this.props.session.email, CONST.SMS.DOMAIN); | ||
|
||
if (userHasPhonePrimaryEmail) { | ||
errorComponent = ( | ||
<View style={[styles.m5]}> | ||
<Text>{this.props.translate('bankAccount.hasPhoneLoginError')}</Text> | ||
</View> | ||
if (this.state.shouldShowContinueSetupButton) { | ||
return ( | ||
<ContinueBankAccountSetup | ||
reimbursementAccount={this.props.reimbursementAccount} | ||
continue={this.continue} | ||
policyName={policyName} | ||
/> | ||
Comment on lines
+346
to
+352
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. cc @luacmartins, This block is duplicated now, check line 384 ,we intentionally changed the order of rendering in this PR #20406. 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. ah nice catch. Do we have a PR to fix this already? 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. No we don't have a PR yet, needed to confirm before moving forward. I will create a PR. 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. PR is ready : #22253 |
||
); | ||
} | ||
|
||
let errorText; | ||
const userHasPhonePrimaryEmail = Str.endsWith(this.props.session.email, CONST.SMS.DOMAIN); | ||
const throttledDate = lodashGet(this.props.reimbursementAccount, 'throttledDate'); | ||
if (throttledDate) { | ||
errorComponent = ( | ||
<View style={[styles.m5]}> | ||
<Text>{this.props.translate('bankAccount.hasBeenThrottledError')}</Text> | ||
</View> | ||
); | ||
const hasUnsupportedCurrency = lodashGet(this.props.policy, 'outputCurrency', '') !== CONST.CURRENCY.USD; | ||
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 line caused an edge case regression, when the policy is empty (deleted from other device) it will display the |
||
|
||
if (userHasPhonePrimaryEmail) { | ||
errorText = this.props.translate('bankAccount.hasPhoneLoginError'); | ||
} else if (throttledDate) { | ||
errorText = this.props.translate('bankAccount.hasBeenThrottledError'); | ||
} else if (hasUnsupportedCurrency) { | ||
errorText = this.props.translate('bankAccount.hasCurrencyError'); | ||
} | ||
|
||
if (errorComponent) { | ||
if (errorText) { | ||
return ( | ||
<ScreenWrapper> | ||
<HeaderWithBackButton | ||
title={this.props.translate('workspace.common.connectBankAccount')} | ||
subtitle={policyName} | ||
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)} | ||
/> | ||
{errorComponent} | ||
<View style={[styles.m5]}> | ||
<Text>{errorText}</Text> | ||
</View> | ||
</ScreenWrapper> | ||
); | ||
} | ||
|
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.
Coming from #37254 (comment)
Because we're using
Onyx.set
, we should have spread the old pendingFields.