Skip to content

Commit

Permalink
Merge pull request #28248 from rojiphil/26679-searchpage-incorrect-su…
Browse files Browse the repository at this point in the history
…btitle-fix

include task status messages in last message text
  • Loading branch information
Gonals authored Oct 2, 2023
2 parents 96f93fe + cac8ad7 commit aaa8ae3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ function getLastMessageTextForReport(report) {
(reportAction, key) => ReportActionUtils.shouldReportActionBeVisible(reportAction, key) && reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
let lastMessageTextFromReport = '';
const lastActionName = lodashGet(lastReportAction, 'actionName', '');

if (ReportUtils.isReportMessageAttachment({text: report.lastMessageText, html: report.lastMessageHtml, translationKey: report.lastMessageTranslationKey})) {
lastMessageTextFromReport = `[${Localize.translateLocal(report.lastMessageTranslationKey || 'common.attachment')}]`;
Expand All @@ -397,6 +398,12 @@ function getLastMessageTextForReport(report) {
} else if (ReportActionUtils.isModifiedExpenseAction(lastReportAction)) {
const properSchemaForModifiedExpenseMessage = ReportUtils.getModifiedExpenseMessage(lastReportAction);
lastMessageTextFromReport = ReportUtils.formatReportLastMessageText(properSchemaForModifiedExpenseMessage, true);
} else if (
lastActionName === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED ||
lastActionName === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED ||
lastActionName === CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED
) {
lastMessageTextFromReport = lodashGet(lastReportAction, 'message[0].text', '');
} else {
lastMessageTextFromReport = report ? report.lastMessageText || '' : '';

Expand Down

0 comments on commit aaa8ae3

Please sign in to comment.