ios: fix delete contact crashing from chat view (#3099)
This commit is contained in:
parent
ba61b15225
commit
5ca2ab6138
@ -440,9 +440,9 @@ struct ChatInfoView: View {
|
|||||||
do {
|
do {
|
||||||
try await apiDeleteChat(type: chat.chatInfo.chatType, id: chat.chatInfo.apiId)
|
try await apiDeleteChat(type: chat.chatInfo.chatType, id: chat.chatInfo.apiId)
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
chatModel.removeChat(chat.chatInfo.id)
|
|
||||||
chatModel.chatId = nil
|
|
||||||
dismiss()
|
dismiss()
|
||||||
|
chatModel.chatId = nil
|
||||||
|
chatModel.removeChat(chat.chatInfo.id)
|
||||||
}
|
}
|
||||||
} catch let error {
|
} catch let error {
|
||||||
logger.error("deleteContactAlert apiDeleteChat error: \(responseError(error))")
|
logger.error("deleteContactAlert apiDeleteChat error: \(responseError(error))")
|
||||||
|
@ -299,9 +299,9 @@ struct GroupChatInfoView: View {
|
|||||||
do {
|
do {
|
||||||
try await apiDeleteChat(type: chat.chatInfo.chatType, id: chat.chatInfo.apiId)
|
try await apiDeleteChat(type: chat.chatInfo.chatType, id: chat.chatInfo.apiId)
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
chatModel.removeChat(chat.chatInfo.id)
|
|
||||||
chatModel.chatId = nil
|
|
||||||
dismiss()
|
dismiss()
|
||||||
|
chatModel.chatId = nil
|
||||||
|
chatModel.removeChat(chat.chatInfo.id)
|
||||||
}
|
}
|
||||||
} catch let error {
|
} catch let error {
|
||||||
logger.error("deleteGroupAlert apiDeleteChat error: \(error.localizedDescription)")
|
logger.error("deleteGroupAlert apiDeleteChat error: \(error.localizedDescription)")
|
||||||
|
Loading…
Reference in New Issue
Block a user