Skip to content

Commit

Permalink
fix: minor fix for displaying last actor
Browse files Browse the repository at this point in the history
  • Loading branch information
koko57 committed Nov 23, 2023
1 parent e532467 commit 519c08c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,14 @@ function getActorNameForPreviewMessage({report, actorID, shouldShowWorkspaceName
* @param {Object} [policy]
* @returns {String}
*/
function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceiptBeingScanned = false, isPreviewMessageForParentChatReport = false, shouldHideParticipantName = false, policy = undefined) {
function getReportPreviewMessage(
report,
reportAction = {},
shouldConsiderReceiptBeingScanned = false,
isPreviewMessageForParentChatReport = false,
shouldHideParticipantName = false,
policy = undefined,
) {
const reportActionMessage = lodashGet(reportAction, 'message[0].html', '');

if (_.isEmpty(report) || !report.reportID) {
Expand Down Expand Up @@ -1886,7 +1893,7 @@ function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceip
actorID: report.managerID,
shouldUseShortForm: true,
shouldShowWorkspaceName: isExpenseReport(report),
policy
policy,
});
const payerName = shouldHideParticipantName ? '' : payerDisplayName;
const formattedAmount = CurrencyUtils.convertToDisplayString(totalAmount, report.currency);
Expand Down
3 changes: 2 additions & 1 deletion src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ function getOptionData(
}
: null;
}
const lastActorDisplayName = hasMultipleParticipants && lastActorDetails?.accountID && Number(lastActorDetails.accountID) !== currentUserAccountID ? lastActorDetails.displayName : '';
const lastActorDisplayName =
hasMultipleParticipants && lastActorDetails?.accountID && Number(lastActorDetails.accountID) !== currentUserAccountID ? lastActorDetails.displayName?.split(' ')[0] : '';
let lastMessageText = lastMessageTextFromReport;

const reportAction = lastReportActions?.[report.reportID];
Expand Down

0 comments on commit 519c08c

Please sign in to comment.