diff --git a/apps/ios/Shared/Views/Chat/ChatInfoView.swift b/apps/ios/Shared/Views/Chat/ChatInfoView.swift index e7a597804..ec4cb9009 100644 --- a/apps/ios/Shared/Views/Chat/ChatInfoView.swift +++ b/apps/ios/Shared/Views/Chat/ChatInfoView.swift @@ -440,9 +440,9 @@ struct ChatInfoView: View { do { try await apiDeleteChat(type: chat.chatInfo.chatType, id: chat.chatInfo.apiId) await MainActor.run { - chatModel.removeChat(chat.chatInfo.id) - chatModel.chatId = nil dismiss() + chatModel.chatId = nil + chatModel.removeChat(chat.chatInfo.id) } } catch let error { logger.error("deleteContactAlert apiDeleteChat error: \(responseError(error))") diff --git a/apps/ios/Shared/Views/Chat/Group/GroupChatInfoView.swift b/apps/ios/Shared/Views/Chat/Group/GroupChatInfoView.swift index 75e81790a..3b9ef347e 100644 --- a/apps/ios/Shared/Views/Chat/Group/GroupChatInfoView.swift +++ b/apps/ios/Shared/Views/Chat/Group/GroupChatInfoView.swift @@ -299,9 +299,9 @@ struct GroupChatInfoView: View { do { try await apiDeleteChat(type: chat.chatInfo.chatType, id: chat.chatInfo.apiId) await MainActor.run { - chatModel.removeChat(chat.chatInfo.id) - chatModel.chatId = nil dismiss() + chatModel.chatId = nil + chatModel.removeChat(chat.chatInfo.id) } } catch let error { logger.error("deleteGroupAlert apiDeleteChat error: \(error.localizedDescription)")