From fc811bbb84a9c75fc89087609e0c2fe04afac36a Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:11:53 +0400 Subject: [PATCH] modify --- apps/ios/Shared/Views/Chat/ChatView.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index 14880fa501..03a2b73ac1 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -305,13 +305,14 @@ struct ChatView: View { do { let (stats, _) = try await apiContactInfo(chat.chatInfo.apiId) await MainActor.run { + var updatedContact = contact + if contact.chatDeleted { + updatedContact.chatDeleted = false + } if let s = stats { - var updatedContact = contact - if contact.chatDeleted { - updatedContact.chatDeleted = false - } - chatModel.updateContactConnectionStats(updatedContact, s) + } else if contact.chatDeleted { + chatModel.updateContact(updatedContact) } } } catch let error {