From 2c09ed0a59ffc3514f06930026ba5c87992a0a86 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 14 Apr 2025 09:51:09 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/features/txhistory/utils/TxHistoryUiManager.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryUiManager.kt b/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryUiManager.kt index 2f4aba1080..c04a88819e 100644 --- a/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryUiManager.kt +++ b/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryUiManager.kt @@ -6,12 +6,14 @@ import com.tangem.domain.txhistory.models.TxHistoryItem import com.tangem.features.txhistory.converter.TxHistoryItemToTransactionStateConverter import com.tangem.features.txhistory.entity.TxHistoryUM import com.tangem.pagination.Batch +import com.tangem.pagination.PaginationStatus import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.mapLatest import java.util.UUID @@ -23,6 +25,8 @@ internal class TxHistoryUiManager( @OptIn(ExperimentalCoroutinesApi::class) val items: Flow> = state + // filter initial states, since we dont emit loading items as UI items + .filter { it.status !is PaginationStatus.None && it.status !is PaginationStatus.InitialLoading } .mapLatest { state -> state.uiBatches.asSequence() .flatMap { it.data }