ios: update chats after setting chat item TTL (#1179)
This commit is contained in:
@@ -430,20 +430,29 @@ struct DatabaseView: View {
|
||||
await MainActor.run {
|
||||
m.chatItemTTL = ttl
|
||||
currentChatItemTTL = ttl
|
||||
progressIndicator = false
|
||||
appFilesCountAndSize = directoryFileCountAndSize(getAppFilesDirectory())
|
||||
afterSetCiTTL()
|
||||
}
|
||||
} catch {
|
||||
await MainActor.run {
|
||||
alert = .error(title: "Error changing setting", error: responseError(error))
|
||||
chatItemTTL = currentChatItemTTL
|
||||
progressIndicator = false
|
||||
appFilesCountAndSize = directoryFileCountAndSize(getAppFilesDirectory())
|
||||
afterSetCiTTL()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func afterSetCiTTL() {
|
||||
progressIndicator = false
|
||||
appFilesCountAndSize = directoryFileCountAndSize(getAppFilesDirectory())
|
||||
do {
|
||||
let chats = try apiGetChats()
|
||||
m.updateChats(with: chats)
|
||||
} catch let error {
|
||||
logger.error("apiGetChats: cannot update chats \(responseError(error))")
|
||||
}
|
||||
}
|
||||
|
||||
private func deleteFiles() {
|
||||
deleteAppFiles()
|
||||
appFilesCountAndSize = directoryFileCountAndSize(getAppFilesDirectory())
|
||||
|
||||
Reference in New Issue
Block a user