Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-09 16:00:16 +03:00
parent 9c3964a45b
commit bbe46b2ab5
2 changed files with 14 additions and 0 deletions

View file

@ -109,6 +109,16 @@ internal class TxHistoryListManager(
)
}
fun txInfoFlow(txHash: String, type: TxInfo.TransactionType): Flow<TxInfo> = state
.map { st ->
st.rawBatches.asSequence()
.flatMap { it.data.items }
.firstOrNull { it.txHash == txHash && it.type == type }
}
.filterNotNull()
.distinctUntilChanged()
.flowOn(dispatchers.default)
private fun updateState(
batchListState: BatchListState<Int, PaginationWrapper<TxInfo>>,
lookupContext: TxHistoryLookupContext?,
@ -121,6 +131,7 @@ internal class TxHistoryListManager(
val isRedesignEnabled = designFeatureToggles.isRedesignEnabled
state.copy(
status = batchListState.status,
rawBatches = batchListState.data,
uiBatches = if (isRedesignEnabled) {
val converter = TxHistoryItemToTransactionItemUMConverter(
currency = currency,

View file

@ -1,5 +1,7 @@
package com.tangem.features.txhistory.utils
import com.tangem.domain.models.network.TxInfo
import com.tangem.domain.txhistory.models.PaginationWrapper
import com.tangem.features.txhistory.entity.TxHistoryItemsUM
import com.tangem.features.txhistory.entity.TxHistoryUM
import com.tangem.pagination.Batch
@ -7,6 +9,7 @@ import com.tangem.pagination.PaginationStatus
data class TxHistoryListState(
val status: PaginationStatus<*> = PaginationStatus.None,
val rawBatches: List<Batch<Int, PaginationWrapper<TxInfo>>> = emptyList(),
val uiBatches: List<Batch<Int, List<TxHistoryItemsUM.TxHistoryItemUM>>> = emptyList(),
val legacyUiBatches: List<Batch<Int, List<TxHistoryUM.TxHistoryItemUM>>> = emptyList(),
)