feat: add AppDatabase and move payment caching to db
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user