Skip to content

Commit

Permalink
code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Velin92 committed Dec 12, 2024
1 parent 4ec3ec2 commit d26c0a1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
guard case let .loaded(requests) = joinRequestsState else {
return []
}
return requests.filter { !$0.isSeen }.map(KnockRequestInfo.init)

return requests
.filter { !$0.isSeen }
.map(KnockRequestInfo.init)
}
// If the requests have the same event ids we can discard the output
.removeDuplicates { Set($0.map(\.eventID)) == Set($1.map(\.eventID)) }
Expand Down

0 comments on commit d26c0a1

Please sign in to comment.