Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-12 15:37:00 +05:00
parent 0a1bb63501
commit c2ef661a16
4 changed files with 9 additions and 8 deletions

View file

@ -16,8 +16,6 @@ interface TxHistoryComponent {
fun LazyListScope.txHistoryContent(listState: LazyListState, state: TxHistoryUM)
fun reload()
data class Params(
val userWalletId: UserWalletId,
val currency: CryptoCurrency,

View file

@ -27,10 +27,6 @@ internal class DefaultTxHistoryComponent @AssistedInject constructor(
txHistoryItems(listState, state)
}
override fun reload() {
model.reload()
}
@AssistedFactory
interface Factory : TxHistoryComponent.Factory {
override fun create(context: AppComponentContext, params: TxHistoryComponent.Params): DefaultTxHistoryComponent

View file

@ -8,8 +8,8 @@ import com.tangem.core.decompose.model.ParamsContainer
import com.tangem.core.navigation.url.UrlOpener
import com.tangem.domain.balancehiding.GetBalanceHidingSettingsUseCase
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.domain.tokens.error.CurrencyStatusError
import com.tangem.domain.tokens.GetCurrencyStatusUpdatesUseCase
import com.tangem.domain.tokens.error.CurrencyStatusError
import com.tangem.domain.tokens.model.CryptoCurrencyStatus
import com.tangem.domain.txhistory.models.TxHistoryStateError
import com.tangem.domain.txhistory.repository.TxHistoryRepositoryV2
@ -66,6 +66,7 @@ internal class TxHistoryModel @Inject constructor(
init {
handleBalanceHiding()
subscribeToUiItemChanges()
initListManager()
loadTxInfo()
subscribeToUpdateListener()
subscribeOnCurrencyStatusUpdates()
@ -83,6 +84,10 @@ internal class TxHistoryModel @Inject constructor(
.launchIn(modelScope)
}
private fun initListManager() {
modelScope.launch { txHistoryListManager.init() }
}
private fun loadTxInfo() {
_uiState.update { state -> getLoadingState(state.isBalanceHidden) }
modelScope.launch {

View file

@ -45,7 +45,7 @@ internal class TxHistoryListManager(
val uiItems: Flow<ImmutableList<TxHistoryUM.TxHistoryItemUM>> = uiManager.items
suspend fun startLoading() = coroutineScope {
suspend fun init() = coroutineScope {
val batchFlow = repository.getTxHistoryBatchFlow(
context = TxHistoryListBatchingContext(
actionsFlow = actionsFlow,
@ -59,7 +59,9 @@ internal class TxHistoryListManager(
.flowOn(dispatchers.default)
.launchIn(scope = this)
.saveIn(jobHolder)
}
suspend fun startLoading() {
actionsFlow.emit(
BatchAction.Reload(
requestParams = TxHistoryListConfig(userWalletId, currency, refresh = false),