mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-21 21:25:43 +00:00
ios: navigation to delete chat working for group members
This commit is contained in:
@@ -340,13 +340,7 @@ func loadChat(chat: Chat, search: String = "") {
|
||||
m.chatItemStatuses = [:]
|
||||
im.reversedChatItems = []
|
||||
let chat = try apiGetChat(type: cInfo.chatType, id: cInfo.apiId, search: search)
|
||||
if case let .direct(contact) = chat.chatInfo, !cInfo.chatDeleted, chat.chatInfo.chatDeleted {
|
||||
var updatedContact = contact
|
||||
updatedContact.chatDeleted = false
|
||||
m.updateContact(updatedContact)
|
||||
} else {
|
||||
m.updateChatInfo(chat.chatInfo)
|
||||
}
|
||||
m.updateChatInfo(chat.chatInfo)
|
||||
im.reversedChatItems = chat.chatItems.reversed()
|
||||
} catch let error {
|
||||
logger.error("loadChat error: \(responseError(error))")
|
||||
|
||||
@@ -306,7 +306,12 @@ struct ChatView: View {
|
||||
let (stats, _) = try await apiContactInfo(chat.chatInfo.apiId)
|
||||
await MainActor.run {
|
||||
if let s = stats {
|
||||
chatModel.updateContactConnectionStats(contact, s)
|
||||
var updatedContact = contact
|
||||
if contact.chatDeleted {
|
||||
updatedContact.chatDeleted = false
|
||||
}
|
||||
|
||||
chatModel.updateContactConnectionStats(updatedContact, s)
|
||||
}
|
||||
}
|
||||
} catch let error {
|
||||
|
||||
@@ -82,9 +82,6 @@ struct ContactListNavLink: View {
|
||||
Button {
|
||||
Task {
|
||||
await MainActor.run {
|
||||
var updatedContact = contact
|
||||
updatedContact.chatDeleted = false
|
||||
ChatModel.shared.updateContact(updatedContact)
|
||||
dismissAllSheets(animated: true) {
|
||||
ChatModel.shared.chatId = contact.id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user