Updated on 2026-08-14
This commit is contained in:
parent
788a471871
commit
28b202b48d
1 changed files with 16 additions and 10 deletions
|
|
@ -21,6 +21,7 @@ import com.tangem.domain.walletmanager.utils.SdkPageConverter
|
|||
import com.tangem.domain.wallets.models.UserWallet
|
||||
import com.tangem.domain.wallets.models.UserWalletId
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import timber.log.Timber
|
||||
|
||||
class DefaultTxHistoryRepository(
|
||||
private val cacheRegistry: CacheRegistry,
|
||||
|
|
@ -82,6 +83,7 @@ class DefaultTxHistoryRepository(
|
|||
pageSize: Int,
|
||||
refresh: Boolean,
|
||||
): List<TxHistoryItem> {
|
||||
return try {
|
||||
cacheRegistry.invokeOnExpire(
|
||||
key = getTxHistoryPageKey(currency, userWalletId, Page.Initial),
|
||||
skipCache = refresh,
|
||||
|
|
@ -91,7 +93,11 @@ class DefaultTxHistoryRepository(
|
|||
key = TxHistoryItemsStore.Key(userWalletId, currency),
|
||||
page = Page.Initial,
|
||||
)?.items
|
||||
return txs ?: emptyList()
|
||||
txs ?: emptyList()
|
||||
} catch (e: Throwable) {
|
||||
Timber.e(e, "Unable to load the transaction history for the requested page: ${Page.Initial}")
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getTxHistoryPageKey(currency: CryptoCurrency, userWalletId: UserWalletId, page: Page): String {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue