Skip to content

Commit 3e77445

Browse files
Merge pull request #36950 from FitseTLT/fix-lhn-bold-issue-for-deleted-message
Fix - LHN - When you delete a message from a room, the conversation in the members remains bolded
2 parents 6a63e02 + e584f66 commit 3e77445

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/libs/SidebarUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ function getOptionData({
242242
result.policyID = report.policyID;
243243
result.stateNum = report.stateNum;
244244
result.statusNum = report.statusNum;
245-
result.isUnread = ReportUtils.isUnread(report);
245+
// When the only message of a report is deleted lastVisibileActionCreated is not reset leading to wrongly
246+
// setting it Unread so we add additional condition here to avoid empty chat LHN from being bold.
247+
result.isUnread = ReportUtils.isUnread(report) && !!report.lastActorAccountID;
246248
result.isUnreadWithMention = ReportUtils.isUnreadWithMention(report);
247249
result.hasDraftComment = report.hasDraft;
248250
result.isPinned = report.isPinned;

tests/ui/UnreadIndicatorsTest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ function signInAndGetAppWithUnreadChat() {
229229
lastVisibleActionCreated: reportAction9CreatedDate,
230230
lastMessageText: 'Test',
231231
participantAccountIDs: [USER_B_ACCOUNT_ID],
232+
lastActorAccountID: USER_B_ACCOUNT_ID,
232233
type: CONST.REPORT.TYPE.CHAT,
233234
});
234235
const createdReportActionID = NumberUtils.rand64();
@@ -388,6 +389,7 @@ describe('Unread Indicators', () => {
388389
lastReadTime: '',
389390
lastVisibleActionCreated: DateUtils.getDBTime(utcToZonedTime(NEW_REPORT_FIST_MESSAGE_CREATED_DATE, 'UTC').valueOf()),
390391
lastMessageText: 'Comment 1',
392+
lastActorAccountID: USER_C_ACCOUNT_ID,
391393
participantAccountIDs: [USER_C_ACCOUNT_ID],
392394
type: CONST.REPORT.TYPE.CHAT,
393395
},

0 commit comments

Comments
 (0)