Updated on 2026-08-14
This commit is contained in:
parent
12e06e5fc1
commit
bf2c65eca3
10 changed files with 18 additions and 13 deletions
|
|
@ -308,6 +308,7 @@ internal object TokenDetailsPreviewData {
|
|||
dialogConfig = null,
|
||||
pendingTxs = persistentListOf(),
|
||||
expressTxs = persistentListOf(),
|
||||
expressTxsToDisplay = persistentListOf(),
|
||||
pullToRefreshConfig = pullToRefreshConfig,
|
||||
bottomSheetConfig = null,
|
||||
isBalanceHidden = false,
|
||||
|
|
@ -338,6 +339,7 @@ internal object TokenDetailsPreviewData {
|
|||
dialogConfig = null,
|
||||
pendingTxs = persistentListOf(),
|
||||
expressTxs = persistentListOf(),
|
||||
expressTxsToDisplay = persistentListOf(),
|
||||
pullToRefreshConfig = pullToRefreshConfig,
|
||||
bottomSheetConfig = null,
|
||||
isBalanceHidden = false,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ internal data class TokenDetailsState(
|
|||
val stakingBlocksState: StakingBlockUM?,
|
||||
val notifications: ImmutableList<TokenDetailsNotification>,
|
||||
val pendingTxs: PersistentList<TransactionState>,
|
||||
val expressTxsToDisplay: PersistentList<ExpressTransactionStateUM>,
|
||||
val expressTxs: PersistentList<ExpressTransactionStateUM>,
|
||||
val txHistoryState: TxHistoryState,
|
||||
val dialogConfig: TokenDetailsDialogConfig?,
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ internal class TokenDetailsSkeletonStateConverter(
|
|||
notifications = persistentListOf(),
|
||||
pendingTxs = persistentListOf(),
|
||||
expressTxs = persistentListOf(),
|
||||
expressTxsToDisplay = persistentListOf(),
|
||||
txHistoryState = TxHistoryState.Content(
|
||||
contentItems = MutableStateFlow(
|
||||
value = TxHistoryState.getDefaultLoadingTransactions(clickIntents::onExploreClick),
|
||||
|
|
|
|||
|
|
@ -98,8 +98,15 @@ internal class ExpressStatusFactory @AssistedInject constructor(
|
|||
if (currentTx is ExpressTransactionStateUM.ExchangeUM && currentTx.activeStatus == ExchangeStatus.Finished) {
|
||||
updateBalance(currentTx.toCryptoCurrency)
|
||||
}
|
||||
val expressTxsToDisplay = expressTxs.filterNot {
|
||||
when (it) {
|
||||
is ExpressTransactionStateUM.ExchangeUM -> false
|
||||
is ExpressTransactionStateUM.OnrampUM -> it.activeStatus.isHidden
|
||||
}
|
||||
}.toPersistentList()
|
||||
return state.copy(
|
||||
expressTxs = expressTxs,
|
||||
expressTxsToDisplay = expressTxsToDisplay,
|
||||
bottomSheetConfig = currentTx?.let(
|
||||
::updateStateWithExpressStatusBottomSheet,
|
||||
) ?: config,
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ internal class OnrampStatusFactory @AssistedInject constructor(
|
|||
ifRight = { onrampTxs ->
|
||||
val transactions = onrampTransactionStateConverter.convertList(onrampTxs)
|
||||
transactions.clearHiddenTerminal()
|
||||
transactions.filterNot { it.activeStatus.isHidden }
|
||||
transactions
|
||||
},
|
||||
ifLeft = { persistentListOf() },
|
||||
)
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ internal fun TokenDetailsScreen(state: TokenDetailsState, tokenMarketBlockCompon
|
|||
}
|
||||
|
||||
expressTransactionsItems(
|
||||
expressTxs = state.expressTxs,
|
||||
expressTxs = state.expressTxsToDisplay,
|
||||
modifier = itemModifier,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,6 @@ internal class TokenDetailsViewModel @Inject constructor(
|
|||
viewModel = this,
|
||||
deepLinks = listOf(
|
||||
BuyCurrencyDeepLink(
|
||||
isOnrampFeatureEnabled = onrampFeatureToggles.isFeatureEnabled,
|
||||
onReceive = ::onBuyCurrencyDeepLink,
|
||||
),
|
||||
),
|
||||
|
|
@ -336,6 +335,7 @@ internal class TokenDetailsViewModel @Inject constructor(
|
|||
expressTxStatusTaskScheduler.scheduleTask(
|
||||
viewModelScope,
|
||||
PeriodicTask(
|
||||
isDelayFirst = false,
|
||||
delay = EXPRESS_STATUS_UPDATE_DELAY,
|
||||
task = {
|
||||
runCatching {
|
||||
|
|
@ -805,7 +805,7 @@ internal class TokenDetailsViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onExpressTransactionClick(txId: String) {
|
||||
val expressTxState = internalUiState.value.expressTxs.first { it.info.txId == txId }
|
||||
val expressTxState = internalUiState.value.expressTxsToDisplay.first { it.info.txId == txId }
|
||||
internalUiState.value = expressStatusFactory.getStateWithExpressStatusBottomSheet(expressTxState)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue