Skip to content

Commit

Permalink
Development: Fix duplicate server calls for messages when selecting a…
Browse files Browse the repository at this point in the history
… conversation (#9611)
  • Loading branch information
PaRangger authored Oct 27, 2024
1 parent b8c922a commit 27f4f60
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export class ConversationMessagesComponent implements OnInit, AfterViewInit, OnD

private subscribeToActiveConversation() {
this.metisConversationService.activeConversation$.pipe(takeUntil(this.ngUnsubscribe)).subscribe((conversation: ConversationDTO) => {
// This statement avoids a bug that reloads the messages when the conversation is already displayed
if (this._activeConversation?.id === conversation.id) {
return;
}
this._activeConversation = conversation;
this.onActiveConversationChange();
});
Expand Down

0 comments on commit 27f4f60

Please sign in to comment.