Updated on 2026-08-14
This commit is contained in:
parent
a2d36ff27c
commit
fa6d35c218
1 changed files with 12 additions and 9 deletions
|
|
@ -5,6 +5,7 @@ import androidx.compose.runtime.mutableStateOf
|
|||
import androidx.compose.runtime.setValue
|
||||
import androidx.lifecycle.*
|
||||
import androidx.paging.PagingData
|
||||
import androidx.paging.cachedIn
|
||||
import arrow.core.Either
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.blockchain.common.TransactionData
|
||||
|
|
@ -348,15 +349,17 @@ internal class SendViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun getTxHistory(): Flow<PagingData<TxHistoryItem>> {
|
||||
return flow {
|
||||
txHistoryItemsUseCase(
|
||||
userWalletId = userWalletId,
|
||||
currency = cryptoCurrency,
|
||||
).fold(
|
||||
ifRight = { emitAll(it.distinctUntilChanged()) },
|
||||
ifLeft = {},
|
||||
)
|
||||
}
|
||||
return txHistoryItemsUseCase(
|
||||
userWalletId = userWalletId,
|
||||
currency = cryptoCurrency,
|
||||
).fold(
|
||||
ifRight = {
|
||||
it.distinctUntilChanged().cachedIn(viewModelScope)
|
||||
},
|
||||
ifLeft = {
|
||||
emptyFlow()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
private fun getTxHistoryCount(): Flow<Int> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue