Skip to content

Commit

Permalink
replace the assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
asliayk committed Dec 14, 2024
1 parent 58a30aa commit 9271ced
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
Expand Down

0 comments on commit 9271ced

Please sign in to comment.