From 9271ced598b5de407fb6356463ac1705dc40f88a Mon Sep 17 00:00:00 2001 From: Asli Aykan Date: Sat, 14 Dec 2024 13:05:22 +0300 Subject: [PATCH] replace the assignment --- .../conversation-messages/conversation-messages.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts b/src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts index 5bb879bf6b37..4efa09c58b76 100644 --- a/src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts +++ b/src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts @@ -141,12 +141,12 @@ export class ConversationMessagesComponent implements OnInit, AfterViewInit, OnD private subscribeToActiveConversation() { this.metisConversationService.activeConversation$.pipe(takeUntil(this.ngUnsubscribe)).subscribe((conversation: ConversationDTO) => { + this.unreadCount = conversation?.unreadMessagesCount || 0; // This statement avoids a bug that reloads the messages when the conversation is already displayed if (conversation && this._activeConversation?.id === conversation.id) { return; } this._activeConversation = conversation; - this.unreadCount = conversation?.unreadMessagesCount || 0; this.onActiveConversationChange(); }); }