Skip to content

Commit

Permalink
Merge pull request #32219 from Expensify/vit-fixNextSteps
Browse files Browse the repository at this point in the history
[Drafts] Do not prefer the expenseMessage in case of next steps
  • Loading branch information
puneetlath authored Nov 29, 2023
2 parents d9bfb27 + 8f50296 commit ef65a0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/MoneyReportHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function MoneyReportHeader({session, personalDetails, policy, chatReport, nextSt
return isManager && !isDraft && !isApproved && !isSettled;
}, [policyType, isManager, isDraft, isApproved, isSettled]);
const shouldShowSubmitButton = isDraft && reimbursableTotal !== 0;
const shouldShowNextSteps = isDraft && nextStep && (!_.isEmpty(nextStep.message) || !_.isEmpty(nextStep.expenseMessage));
const shouldShowNextSteps = isDraft && nextStep && !_.isEmpty(nextStep.message);
const shouldShowAnyButton = shouldShowSettlementButton || shouldShowApproveButton || shouldShowSubmitButton || shouldShowNextSteps;
const bankAccountRoute = ReportUtils.getBankAccountRoute(chatReport);
const formattedAmount = CurrencyUtils.convertToDisplayString(reimbursableTotal, moneyRequestReport.currency);
Expand Down
5 changes: 2 additions & 3 deletions src/components/MoneyReportHeaderStatusBar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useMemo} from 'react';
import {Text, View} from 'react-native';
import _ from 'underscore';
import useLocalize from '@hooks/useLocalize';
import * as NextStepUtils from '@libs/NextStepUtils';
import nextStepPropTypes from '@pages/nextStepPropTypes';
Expand All @@ -21,9 +20,9 @@ function MoneyReportHeaderStatusBar({nextStep}) {
const {translate} = useLocalize();

const messageContent = useMemo(() => {
const messageArray = _.isEmpty(nextStep.expenseMessage) ? nextStep.message : nextStep.expenseMessage;
const messageArray = nextStep.message;
return NextStepUtils.parseMessage(messageArray);
}, [nextStep.expenseMessage, nextStep.message]);
}, [nextStep.message]);

return (
<View style={[styles.dFlex, styles.flexRow, styles.alignItemsCenter, styles.overflowHidden, styles.w100]}>
Expand Down

0 comments on commit ef65a0a

Please sign in to comment.