Skip to content

Commit

Permalink
Merge pull request Expensify#14483 from abdulrahuman5196/add-payment-…
Browse files Browse the repository at this point in the history
…delay
  • Loading branch information
thienlnam authored Jan 24, 2023
2 parents 614da95 + 378dffc commit 25b47da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pages/settings/Payments/PaymentMethodList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import {FlatList} from 'react-native';
import lodashGet from 'lodash/get';
import {withOnyx} from 'react-native-onyx';
import {withNetwork} from '../../../components/OnyxProvider';
import styles from '../../../styles/styles';
import * as StyleUtils from '../../../styles/StyleUtils';
import MenuItem from '../../../components/MenuItem';
Expand Down Expand Up @@ -126,6 +127,11 @@ class PaymentMethodList extends Component {
combinedPaymentMethods = _.filter(combinedPaymentMethods, paymentMethod => paymentMethod.accountType === this.props.filterType);
}

if (!this.props.network.isOffline) {
combinedPaymentMethods = _.filter(combinedPaymentMethods, paymentMethod => paymentMethod.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE
|| !_.isEmpty(paymentMethod.errors));
}

combinedPaymentMethods = _.map(combinedPaymentMethods, paymentMethod => ({
...paymentMethod,
onPress: e => this.props.onPress(e, paymentMethod.accountType, paymentMethod.accountData, paymentMethod.isDefault, paymentMethod.methodID),
Expand Down Expand Up @@ -258,6 +264,7 @@ PaymentMethodList.defaultProps = defaultProps;

export default compose(
withLocalize,
withNetwork(),
withOnyx({
bankAccountList: {
key: ONYXKEYS.BANK_ACCOUNT_LIST,
Expand Down

0 comments on commit 25b47da

Please sign in to comment.