Skip to content

Commit

Permalink
Remove redundant state
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaHCD committed Oct 4, 2022
1 parent 822c927 commit a8f673f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/pages/ReimbursementAccount/RequestorOnfidoStep.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import lodashGet from 'lodash/get';
import {ScrollView} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -31,15 +30,12 @@ class RequestorOnfidoStep extends React.Component {
constructor(props) {
super(props);
this.submit = this.submit.bind(this);
this.state = {
onfidoData: lodashGet(props, ['reimbursementAccount', 'achData', 'onfidoData'], ''),
};
}

submit() {
submit(onfidoData) {
BankAccounts.verifyIdentityForBankAccount(
ReimbursementAccountUtils.getDefaultStateForField(this.props, 'bankAccountID', 0),
this.state.onfidoData,
onfidoData,
);
this.props.onComplete();
}
Expand All @@ -59,9 +55,7 @@ class RequestorOnfidoStep extends React.Component {
BankAccounts.goToWithdrawalAccountSetupStep(CONST.BANK_ACCOUNT.STEP.COMPANY);
}}
onSuccess={(onfidoData) => {
this.setState({
onfidoData,
}, this.submit);
this.submit(onfidoData);
}}
/>
</ScrollView>
Expand Down

0 comments on commit a8f673f

Please sign in to comment.