Skip to content

Commit

Permalink
Only show iou.pay, not reimbursed action to avoid duplicate message
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuoch committed Jul 24, 2023
1 parent 388d977 commit 1158139
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ const CONST = {
TASKCANCELLED: 'TASKCANCELLED',
IOU: 'IOU',
REIMBURSEMENTQUEUED: 'REIMBURSEMENTQUEUED',
REIMBURSED: 'REIMBURSED',
RENAMED: 'RENAMED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
TASKCOMPLETED: 'TASKCOMPLETED',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function isSettled(reportID) {
*/
function isCurrentUserSubmitter(reportID) {
const report = lodashGet(allReports, `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {});
return report.ownerEmail === currentUserEmail;
return report && report.ownerEmail === currentUserEmail;
}

/**
Expand Down
8 changes: 0 additions & 8 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import * as Session from '../../../libs/actions/Session';
import MoneyRequestView from '../../../components/ReportActionItem/MoneyRequestView';
import {hideContextMenu} from './ContextMenu/ReportActionContextMenu';
import * as PersonalDetailsUtils from '../../../libs/PersonalDetailsUtils';
import * as CurrencyUtils from '../../../libs/CurrencyUtils';
import ReportActionItemBasicMessage from './ReportActionItemBasicMessage';
import * as store from '../../../libs/actions/ReimbursementAccount/store';
import * as BankAccounts from '../../../libs/actions/BankAccounts';
Expand Down Expand Up @@ -308,13 +307,6 @@ function ReportActionItem(props) {
) : null}
</ReportActionItemBasicMessage>
);
} else if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSED) {
const amount = CurrencyUtils.convertToDisplayString(ReportUtils.getMoneyRequestTotal(props.report), props.report.currency);
const submitterDisplayName = PersonalDetailsUtils.getDisplayNameOrDefault(props.personalDetailsList, [props.report.ownerAccountID, 'displayName'], props.report.ownerEmail);
const message = props.action.originalMessage.isSubmitterAddingBankAccount
? props.translate('iou.settledAfterAddedBankAccount', {submitterDisplayName, amount})
: props.translate('iou.payerSettled', {amount});
children = <ReportActionItemBasicMessage message={message} />;
} else {
const message = _.last(lodashGet(props.action, 'message', [{}]));
const hasBeenFlagged = !_.contains([CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING], moderationDecision);
Expand Down

0 comments on commit 1158139

Please sign in to comment.