Skip to content

Commit

Permalink
Merge pull request #30113 from Expensify/revert-30079-techievivek_fix…
Browse files Browse the repository at this point in the history
…_double_message

Revert "[Internal QA] Skip rendering content for pay action on non-send money flow"
  • Loading branch information
mountiny authored Oct 20, 2023
2 parents 3b43b7f + 7f44960 commit fcee207
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ function ReportActionItem(props) {

const highlightedBackgroundColorIfNeeded = useMemo(() => (isReportActionLinked ? StyleUtils.getBackgroundColorStyle(themeColors.highlightBG) : {}), [isReportActionLinked]);

const originalMessage = lodashGet(props.action, 'originalMessage', {});

// IOUDetails only exists when we are sending money
const isSendingMoney = originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && _.has(originalMessage, 'IOUDetails');

// When active action changes, we need to update the `isContextMenuActive` state
const isActiveReportActionForMenu = ReportActionContextMenu.isActiveReportAction(props.action.reportActionID);
useEffect(() => {
Expand Down Expand Up @@ -306,6 +301,10 @@ function ReportActionItem(props) {
*/
const renderItemContent = (hovered = false, isWhisper = false, hasErrors = false) => {
let children;
const originalMessage = lodashGet(props.action, 'originalMessage', {});

// IOUDetails only exists when we are sending money
const isSendingMoney = originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && _.has(originalMessage, 'IOUDetails');

// Show the MoneyRequestPreview for when request was created, bill was split or money was sent
if (
Expand Down Expand Up @@ -624,12 +623,6 @@ function ReportActionItem(props) {
);
}

// For the `pay` IOU action on non-send money flow we don't want to show anything
// as the preview action is already shown by the create IOU action above
if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && originalMessage && originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && !isSendingMoney) {
return null;
}

const hasErrors = !_.isEmpty(props.action.errors);
const whisperedToAccountIDs = props.action.whisperedToAccountIDs || [];
const isWhisper = whisperedToAccountIDs.length > 0;
Expand Down

0 comments on commit fcee207

Please sign in to comment.