Updated on 2026-08-14
This commit is contained in:
parent
b19deae346
commit
97afda563f
1 changed files with 6 additions and 3 deletions
|
|
@ -219,6 +219,8 @@ internal class TokenDetailsViewModel @Inject constructor(
|
|||
viewModelScope.launch(dispatchers.io) {
|
||||
swapTxStatusTaskScheduler.cancelTask()
|
||||
exchangeStatusFactory.invoke()
|
||||
.distinctUntilChanged()
|
||||
.filterNot { it.isEmpty() }
|
||||
.onEach { swapTxs ->
|
||||
swapTxStatusTaskScheduler.scheduleTask(
|
||||
viewModelScope,
|
||||
|
|
@ -230,13 +232,14 @@ internal class TokenDetailsViewModel @Inject constructor(
|
|||
}
|
||||
},
|
||||
onSuccess = { updatedTxs ->
|
||||
val config = uiState.bottomSheetConfig?.content as? ExchangeStatusBottomSheetConfig
|
||||
val currentTx = updatedTxs.firstOrNull { it.txId == config?.value?.txId }
|
||||
val config = uiState.bottomSheetConfig
|
||||
val exchangeBottomSheet = config?.content as? ExchangeStatusBottomSheetConfig
|
||||
val currentTx = updatedTxs.firstOrNull { it.txId == exchangeBottomSheet?.value?.txId }
|
||||
uiState = uiState.copy(
|
||||
swapTxs = updatedTxs,
|
||||
bottomSheetConfig = currentTx?.let(
|
||||
stateFactory::updateStateWithExchangeStatusBottomSheet,
|
||||
),
|
||||
) ?: config,
|
||||
)
|
||||
},
|
||||
onError = {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue