Add 1-hour cache timeout and fix pull-to-refresh across iOS
- Add configurable cache timeout (CACHE_TIMEOUT_MS) to DataManager - Fix cache to work with empty results (contractors, documents, residences) - Change Documents/Warranties view to use client-side filtering for cache efficiency - Add pull-to-refresh support for empty state views in ListAsyncContentView - Fix ContractorsListView to pass forceRefresh parameter correctly - Fix TaskViewModel loading spinner not stopping after refresh completes - Remove duplicate cache checks in iOS ViewModels, delegate to Kotlin APILayer 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -223,11 +223,17 @@ struct ListAsyncContentView<T, Content: View, EmptyContent: View>: View {
|
||||
var body: some View {
|
||||
Group {
|
||||
if let errorMessage = errorMessage, items.isEmpty {
|
||||
DefaultErrorView(message: errorMessage, onRetry: onRetry)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
// Wrap in ScrollView for pull-to-refresh support
|
||||
ScrollView {
|
||||
DefaultErrorView(message: errorMessage, onRetry: onRetry)
|
||||
.frame(maxWidth: .infinity, minHeight: UIScreen.main.bounds.height * 0.6)
|
||||
}
|
||||
} else if items.isEmpty && !isLoading {
|
||||
emptyContent()
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
// Wrap in ScrollView for pull-to-refresh support
|
||||
ScrollView {
|
||||
emptyContent()
|
||||
.frame(maxWidth: .infinity, minHeight: UIScreen.main.bounds.height * 0.6)
|
||||
}
|
||||
} else {
|
||||
content(items)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user