diff --git a/apps/ios/Shared/Views/Database/DatabaseView.swift b/apps/ios/Shared/Views/Database/DatabaseView.swift index edb6d2b70..772adc4e0 100644 --- a/apps/ios/Shared/Views/Database/DatabaseView.swift +++ b/apps/ios/Shared/Views/Database/DatabaseView.swift @@ -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())