We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1e1ac1 commit fb3cab7Copy full SHA for fb3cab7
1 file changed
Sources/App/Services/ChatService.swift
@@ -98,8 +98,8 @@ actor ChatService: ChatServiceProtocol {
98
}
99
100
func chats(with userId: UserID, fullInfo: Bool) async throws -> [ChatInfo] {
101
- try await repo.all(with: userId, fullInfo: fullInfo).map {
102
- ChatInfo(from: $0, fullInfo: fullInfo)
+ try await repo.all(with: userId, fullInfo: fullInfo).compactMap {
+ $0.chat.lastMessage == nil ? nil : ChatInfo(from: $0, fullInfo: fullInfo)
103
104
105
0 commit comments