Skip to content

Commit

Permalink
Merge pull request #27700 from koko57/fix/26669-LHN-logic-for-paid-re…
Browse files Browse the repository at this point in the history
…ports

Fix/26669 lhn logic for paid reports
  • Loading branch information
mountiny authored Sep 27, 2023
2 parents 31bb197 + 765d45b commit 5a3cce2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libs/SidebarUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ function getOptionData(report, reportActions, personalDetails, preferredLocale,
}
: null;
}
let lastMessageText =
hasMultipleParticipants && lastActorDetails && lastActorDetails.accountID && Number(lastActorDetails.accountID) !== currentUserAccountID ? `${lastActorDetails.displayName}: ` : '';
lastMessageText += report ? lastMessageTextFromReport : '';
const lastActorDisplayName =
hasMultipleParticipants && lastActorDetails && lastActorDetails.accountID && Number(lastActorDetails.accountID) !== currentUserAccountID ? lastActorDetails.displayName : '';
let lastMessageText = lastMessageTextFromReport;

if (result.isArchivedRoom) {
const archiveReason =
Expand All @@ -354,6 +354,8 @@ function getOptionData(report, reportActions, personalDetails, preferredLocale,
result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.reopened')}: ${report.reportName}`;
} else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED) {
result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.completed')}: ${report.reportName}`;
} else if (lodashGet(lastAction, 'actionName', '') !== CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && lastActorDisplayName && lastMessageTextFromReport) {
result.alternateText = `${lastActorDisplayName}: ${lastMessageText}`;
} else {
result.alternateText = lastMessageTextFromReport.length > 0 ? lastMessageText : Localize.translate(preferredLocale, 'report.noActivityYet');
}
Expand Down

0 comments on commit 5a3cce2

Please sign in to comment.