feat: add AppDatabase and move payment caching to db

This commit is contained in:
2026-06-01 14:25:50 +02:00
parent b5473bfafc
commit 18c8697ce9
11 changed files with 180 additions and 46 deletions
@@ -35,9 +35,7 @@ class HistoryViewModel(
// Cache read moved to IO dispatcher — never blocks the main thread,
// so navigation to HistoryScreen is instant on tap.
viewModelScope.launch {
val cached = withContext(Dispatchers.IO) {
paymentCache.loadCachedPayments()
}
val cached = paymentCache.loadCachedPayments()
if (cached.isNotEmpty()) {
Log.d("HistoryViewModel", "PAYMENTS [INIT ] Showing ${cached.size} cached payments immediately")
_state.value = HistoryState.Success(