Skip to content

Commit

Permalink
Fix display name displays twice on LHN after receiving payment
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Feb 28, 2024
1 parent 98461f9 commit 05ca961
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,12 @@ function getOptionData({

let lastMessageText = lastMessageTextFromReport;

const reportAction = lastReportActions?.[report.reportID];
const lastAction = visibleReportActionItems[report.reportID];

const isThreadMessage =
ReportUtils.isThread(report) && reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && reportAction?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
ReportUtils.isThread(report) && lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && lastAction?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;

if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !result.isArchivedRoom) {
const lastAction = visibleReportActionItems[report.reportID];

if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
const newName = lastAction?.originalMessage?.newName ?? '';
result.alternateText = Localize.translate(preferredLocale, 'newRoomPage.roomRenamedTo', {newName});
Expand Down

0 comments on commit 05ca961

Please sign in to comment.