Updated on 2026-08-14
This commit is contained in:
parent
6ee898a262
commit
cef5863d91
2 changed files with 5 additions and 4 deletions
|
|
@ -84,12 +84,13 @@ internal class ExchangeStatusFactory(
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun removeTransactionOnBottomSheetClosed(): TokenDetailsState {
|
||||
suspend fun removeTransactionOnBottomSheetClosed(isForceTerminal: Boolean = false): TokenDetailsState {
|
||||
val state = currentStateProvider()
|
||||
val bottomSheetConfig = state.bottomSheetConfig?.content as? ExchangeStatusBottomSheetConfig ?: return state
|
||||
val selectedTx = bottomSheetConfig.value
|
||||
|
||||
return if (selectedTx.activeStatus.isTerminal(selectedTx.isRefundTerminalStatus)) {
|
||||
val shouldTerminate = selectedTx.activeStatus.isTerminal(selectedTx.isRefundTerminalStatus) || isForceTerminal
|
||||
return if (shouldTerminate) {
|
||||
swapTransactionRepository.removeTransaction(
|
||||
userWalletId = userWalletId,
|
||||
fromCryptoCurrency = selectedTx.fromCryptoCurrency,
|
||||
|
|
|
|||
|
|
@ -718,8 +718,8 @@ internal class TokenDetailsViewModel @Inject constructor(
|
|||
|
||||
override fun onGoToRefundedTokenClick(cryptoCurrency: CryptoCurrency) {
|
||||
if (internalUiState.value.bottomSheetConfig?.content is ExchangeStatusBottomSheetConfig) {
|
||||
viewModelScope.launch(dispatchers.main) {
|
||||
internalUiState.value = exchangeStatusFactory.removeTransactionOnBottomSheetClosed()
|
||||
viewModelScope.launch {
|
||||
internalUiState.value = exchangeStatusFactory.removeTransactionOnBottomSheetClosed(true)
|
||||
}
|
||||
}
|
||||
internalUiState.value = stateFactory.getStateWithClosedBottomSheet()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue