Skip to content

Commit

Permalink
Merge pull request #29946 from DylanDylann/fix/29336-send-money-app-c…
Browse files Browse the repository at this point in the history
…rash-on-pay-elsewhere

Fix/29336:  App crash on pay elsewhere
  • Loading branch information
Julesssss authored Oct 23, 2023
2 parents 168138b + ee7754b commit 743a95d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import _ from 'underscore';
import {View} from 'react-native';
import lodashGet from 'lodash/get';
import {useIsFocused} from '@react-navigation/native';
import {isEmpty} from 'lodash';
import Text from './Text';
import styles from '../styles/styles';
import * as ReportUtils from '../libs/ReportUtils';
Expand Down Expand Up @@ -42,6 +43,7 @@ import * as IOU from '../libs/actions/IOU';
import * as TransactionUtils from '../libs/TransactionUtils';
import * as PolicyUtils from '../libs/PolicyUtils';
import * as MoneyRequestUtils from '../libs/MoneyRequestUtils';
import {iouDefaultProps, iouPropTypes} from '../pages/iou/propTypes';

const propTypes = {
/** Callback to inform parent modal of success */
Expand Down Expand Up @@ -165,6 +167,9 @@ const propTypes = {

/** Collection of tags attached to a policy */
policyTags: tagPropTypes,

/** Holds data related to Money Request view state, rather than the underlying Money Request data. */
iou: iouPropTypes,
};

const defaultProps = {
Expand Down Expand Up @@ -199,6 +204,7 @@ const defaultProps = {
isScanRequest: false,
shouldShowSmartScanFields: true,
isPolicyExpenseChat: false,
iou: iouDefaultProps,
};

function MoneyRequestConfirmationList(props) {
Expand Down Expand Up @@ -542,7 +548,6 @@ function MoneyRequestConfirmationList(props) {

const {image: receiptImage, thumbnail: receiptThumbnail} =
props.receiptPath && props.receiptFilename ? ReceiptUtils.getThumbnailAndImageURIs(transaction, props.receiptPath, props.receiptFilename) : {};

return (
<OptionsSelector
sections={optionSelectorSections}
Expand All @@ -559,7 +564,7 @@ function MoneyRequestConfirmationList(props) {
shouldShowTextInput={false}
shouldUseStyleForChildren={false}
optionHoveredStyle={canModifyParticipants ? styles.hoveredComponentBG : {}}
footerContent={footerContent}
footerContent={!isEmpty(props.iou.id) && footerContent}
listStyles={props.listStyles}
shouldAllowScrollingChildren
>
Expand Down Expand Up @@ -757,5 +762,8 @@ export default compose(
policy: {
key: ({policyID}) => `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
},
iou: {
key: ONYXKEYS.IOU,
},
}),
)(MoneyRequestConfirmationList);

0 comments on commit 743a95d

Please sign in to comment.