diff --git a/src/components/ReportActionItem/IOUPreview.js b/src/components/ReportActionItem/IOUPreview.js index 4bc60914bb4d..3fab478bb42d 100644 --- a/src/components/ReportActionItem/IOUPreview.js +++ b/src/components/ReportActionItem/IOUPreview.js @@ -128,11 +128,7 @@ const defaultProps = { }; const IOUPreview = (props) => { - // Usually the parent determines whether the IOU Preview is displayed. But as the iouReport total cannot be known - // until it is stored locally, we need to make this check within the Component after retrieving it. This allows us - // to handle the loading UI from within this Component instead of needing to declare it within each parent, which - // would duplicate and complicate the logic - if (props.iouReport.total === 0) { + if (_.isEmpty(props.iouReport)) { return null; } const sessionEmail = lodashGet(props.session, 'email', null); diff --git a/src/components/ReportActionItem/MoneyRequestAction.js b/src/components/ReportActionItem/MoneyRequestAction.js index 801f807e36c5..7efc36baf8ae 100644 --- a/src/components/ReportActionItem/MoneyRequestAction.js +++ b/src/components/ReportActionItem/MoneyRequestAction.js @@ -2,6 +2,7 @@ import _ from 'underscore'; import React from 'react'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; +import lodashGet from 'lodash/get'; import ONYXKEYS from '../../ONYXKEYS'; import CONST from '../../CONST'; import {withNetwork} from '../OnyxProvider'; @@ -69,7 +70,7 @@ const defaultProps = { }; const MoneyRequestAction = (props) => { - const hasMultipleParticipants = props.chatReport.participants.length > 1; + const hasMultipleParticipants = lodashGet(props.chatReport, 'participants', []).length > 1; const onIOUPreviewPressed = () => { if (hasMultipleParticipants) { Navigation.navigate(ROUTES.getReportParticipantsRoute(props.chatReportID)); diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 38b5bda6f713..c27d76ec149d 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -184,7 +184,11 @@ class ReportActionItem extends Component { */ renderItemContent(hovered = false) { let children; - if (this.props.action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU) { + if ( + this.props.action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && + this.props.action.originalMessage.type !== CONST.IOU.REPORT_ACTION_TYPE.DELETE && + this.props.action.originalMessage.type !== CONST.IOU.REPORT_ACTION_TYPE.PAY + ) { // There is no single iouReport for bill splits, so only 1:1 requests require an iouReportID const iouReportID = this.props.action.originalMessage.IOUReportID ? this.props.action.originalMessage.IOUReportID.toString() : '0'; diff --git a/src/pages/iou/IOUDetailsModal.js b/src/pages/iou/IOUDetailsModal.js index 630fb9836071..3403bf83fb23 100644 --- a/src/pages/iou/IOUDetailsModal.js +++ b/src/pages/iou/IOUDetailsModal.js @@ -186,7 +186,7 @@ class IOUDetailsModal extends Component { 1} + isBillSplit={lodashGet(this.props, 'chatReport.participants', []).length > 1} isIOUAction={false} pendingAction={pendingAction} />