mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
made open first unread more stable
This commit is contained in:
@@ -316,6 +316,12 @@ final class ChatModel: ObservableObject {
|
||||
chats[i].created = Date.now
|
||||
}
|
||||
}
|
||||
|
||||
func updateChatStats(id: String, cStats: ChatStats) {
|
||||
if let i = getChatIndex(id) {
|
||||
chats[i].chatStats = cStats
|
||||
}
|
||||
}
|
||||
|
||||
func updateContactConnection(_ contactConnection: PendingContactConnection) {
|
||||
updateChat(.contactConnection(contactConnection: contactConnection))
|
||||
|
||||
@@ -344,6 +344,7 @@ func loadChat(chat: Chat, search: String = "", clearItems: Bool = true) async {
|
||||
let chat = try await apiGetChat(type: cInfo.chatType, id: cInfo.apiId, search: search)
|
||||
await MainActor.run {
|
||||
im.reversedChatItems = chat.chatItems.reversed()
|
||||
m.updateChatStats(id: chat.chatInfo.id, cStats: chat.chatStats)
|
||||
m.updateChatInfo(chat.chatInfo)
|
||||
}
|
||||
} catch let error {
|
||||
|
||||
Reference in New Issue
Block a user