reload all chats on swipe

This commit is contained in:
spaced4ndy
2023-09-20 11:59:19 +04:00
parent c5acd68726
commit 22c8372301
@@ -69,6 +69,13 @@ struct ChatListView: View {
Task {
do {
try await reconnectAllServers()
await MainActor.run {
chatModel.chats.removeAll()
}
let chats = try apiGetChats()
await MainActor.run {
chatModel.chats = chats.map { Chat.init($0) }
}
} catch let error {
AlertManager.shared.showAlertMsg(title: "Error", message: "\(responseError(error))")
}