diff --git a/src/pages/settings/Payments/PaymentMethodList.js b/src/pages/settings/Payments/PaymentMethodList.js index ba5c5ecd29f..8074bf70356 100644 --- a/src/pages/settings/Payments/PaymentMethodList.js +++ b/src/pages/settings/Payments/PaymentMethodList.js @@ -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'; @@ -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), @@ -258,6 +264,7 @@ PaymentMethodList.defaultProps = defaultProps; export default compose( withLocalize, + withNetwork(), withOnyx({ bankAccountList: { key: ONYXKEYS.BANK_ACCOUNT_LIST,