Skip to content

Commit

Permalink
flatMap
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisamir98 committed May 11, 2023
1 parent 67e412e commit 9b2f613
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/script/conversation/ConversationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@ export class ConversationRepository {
}

public async refreshAllConversationsUnavailableParticipants(): Promise<void> {
const allUnavailableUsers: User[] = [];
this.conversationState.conversations().forEach(conversation => {
allUnavailableUsers.push(...conversation.allUserEntities().filter(user => !user.isAvailable()));
const allUnavailableUsers = this.conversationState.conversations().flatMap(conversation => {
return conversation.allUserEntities().filter(user => !user.isAvailable());
});

if (!allUnavailableUsers.length) {
return;
}
Expand Down

0 comments on commit 9b2f613

Please sign in to comment.