diff --git a/common/ui/src/main/java/com/tangem/common/ui/expressStatus/ExpressHideButton.kt b/common/ui/src/main/java/com/tangem/common/ui/expressStatus/ExpressHideButton.kt new file mode 100644 index 0000000000..9c9723be6f --- /dev/null +++ b/common/ui/src/main/java/com/tangem/common/ui/expressStatus/ExpressHideButton.kt @@ -0,0 +1,44 @@ +package com.tangem.common.ui.expressStatus + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.clickable +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.material3.ripple +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import com.tangem.core.ui.R +import com.tangem.core.ui.extensions.stringResourceSafe +import com.tangem.core.ui.res.TangemTheme + +@Composable +fun ExpressHideButton(isTerminal: Boolean, isAutoDisposable: Boolean, onClick: () -> Unit) { + AnimatedVisibility( + visible = isTerminal && !isAutoDisposable, + label = "Hide button visibility animation", + ) { + Text( + text = stringResourceSafe(R.string.express_status_hide_button_text), + color = TangemTheme.colors.text.tertiary, + style = TangemTheme.typography.button, + textAlign = TextAlign.Center, + modifier = Modifier + .fillMaxWidth() + .padding(start = 12.dp, end = 12.dp, top = 14.dp) + .clip(RoundedCornerShape(12.dp)) + .clickable( + interactionSource = remember { MutableInteractionSource() }, + indication = ripple(bounded = false), + onClick = onClick, + ) + .padding(vertical = 10.dp), + ) + } +} \ No newline at end of file diff --git a/common/ui/src/main/java/com/tangem/common/ui/expressStatus/state/ExpressTransactionStateUM.kt b/common/ui/src/main/java/com/tangem/common/ui/expressStatus/state/ExpressTransactionStateUM.kt index 45138854f8..fb2489e331 100644 --- a/common/ui/src/main/java/com/tangem/common/ui/expressStatus/state/ExpressTransactionStateUM.kt +++ b/common/ui/src/main/java/com/tangem/common/ui/expressStatus/state/ExpressTransactionStateUM.kt @@ -30,6 +30,7 @@ data class ExpressTransactionStateInfoUM( val timestampFormatted: TextReference, val onGoToProviderClick: (String) -> Unit, val onClick: () -> Unit, + val onDisposeExpressStatus: () -> Unit, val iconState: ExpressTransactionStateIconUM, val toAmount: TextReference, val toFiatAmount: TextReference?, diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index ae312288dd..8a48bdcc9f 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -314,6 +314,9 @@ Gekauft %s Kauf %s Kauf %s… + Diese Transaktion ausblenden + Sobald dieser Bildschirm ausgeblendet wurde, kann er nicht mehr aufgerufen werden. + Bist Du sicher, dass Du die Transaktionsdetails ausblenden willst? Keine Token gefunden. Bitte versuche eine andere Anfrage ID: %s Transaktions-ID kopiert @@ -790,6 +793,8 @@ Migrieren Natives Staking Derzeit sind keine aktiven Validatoren für das Staking verfügbar. Bitte versuchen Sie es später erneut. + Beim Staking im Cardano Netzwerk wird das gesamte Guthaben genutzt. Zusätzlich werden 2 ADA reserviert und nach dem Unstaking zurückgegeben. Deine ADA sind während des Stakings nicht gesperrt. + Einzelheiten zum ADA-Staking Verdiente Belohnungen werden an Deine Wallet gesendet und stehen Dir sofort zur Verfügung Stake sicher und verdienen Belohnungen Sicher staken und tägliche Belohnungen verdienen. @@ -803,6 +808,8 @@ Verdiene Staking-Belohnungen Dein verbleibender Stakingbetrag ist zu niedrig, um den Einsatz aufzuheben. Du musst mehr Staken, um den Mindestbetrag zum Aufheben des Einsatzes zu erreichen. Niedriges Stakingguthaben + Für erneutes Staking sind mindestens %1$s %2$s erforderlich. Bitte lade Dein Guthaben auf. + Nicht genug %s Aufgrund von Netzwerkproblemen ist Staking derzeit nicht verfügbar. Bitte versuche es später erneut. Beim Staking im %1$s -Netzwerk mit einem neuen Validator werden alle zuvor eingesetzten Kryptos automatisch an diesen Validator übertragen Reinvestiert Deine verdienten Prämien in Deinen Einsatzbetrag und erhöht so den potenziellen Gewinn. diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index 287efe4ff4..d7232f22fd 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -648,7 +648,7 @@ 工場出荷時設定にリセットすると、選択したカードやリングからウォレットが完全に削除されます。現在のウォレットを復元したり、カードやリングを使用してアクセスコードを復元することはできません。 工場出荷時の状態にリセットすると、選択したカードやリングからウォレットが完全に削除され、アプリから削除されます。現在のウォレットを復元することはできません。 Tangem Ringユーザーは、11/15日までChangelly経由でスワップを3回手数料ゼロで行えます! - 今すぐ手数料0%でスワップしましょう! + 今すぐ手数料0% でスワップしましょう! アプリにログインして、カードまたはリングをスキャンせずに残高を確認できます アプリにアクセスする 生体認証の使用を許可する @@ -780,6 +780,8 @@ 移行 ネイティブステーキング 現在、ステーキングに使用できるアクティブなバリデータは見つかりません。しばらくしてからもう一度お試しください。 + Cardanoネットワークでステーキングする場合、残高全体が使用されます。追加の2ADAが予約され、ステーキング解除後に返却されます。ステーキング中はADAはロックされません。 + ADAステーキングの詳細 獲得した報酬はあなたのアドレスに直接送られ、すぐ使用可能です。 安全にステーキングして報酬を獲得しましょう 安全にステーキングして、報酬を毎日獲得しましょう @@ -988,7 +990,7 @@ %sネットワーク アドレスがクリップボードにコピーされました インターネット接続がありません - 今すぐ10 %オフで購入 + 今すぐ10 % オフで購入 1.3万種類以上の暗号資産にアクセス。ワンタップで買付、売却、スワップ、ステーキングが可能です。\nバックアップ用に最大3枚のカードを連携できます。 Tangemウォレットを見る ウォレット設定 diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 868f58f4a9..0fc0d39a01 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -142,6 +142,7 @@ Synchronize addresses Go to provider Go to token + Hide hour Import In progress @@ -314,6 +315,9 @@ Bought %s Buying %s Buying %s... + Hide this transaction + Once hidden, the transaction status cannot be viewed again. You can simply swipe to dismiss instead. + Hide Transaction Status? No tokens found. Please try another request ID: %s Transaction ID copied @@ -790,6 +794,8 @@ Migrate Native staking No active validators available for staking at the moment. Please try again later. + When staking in the Cardano network, the entire balance is used. An additional 2 ADA will be reserved and returned after unstaking. Your ADA is not locked while staking. + ADA Staking Details Earned rewards will be sent to your wallet and available for use immediately Stake securely and start earning your rewards Stake securely and start earning daily rewards @@ -803,6 +809,8 @@ Earn staking rewards Your remaining staked balance will be too low to unstake. You’ll need to stake more to meet the minimum unstake amount. Low staked balance + A minimum of %1$s %2$s is required for restaking. Please top up your balance. + Not enough %s Staking is currently unavailable due to network conditions. Please try again later. Staking in the %1$s network with a new validator will automatically transfer all previously staked funds to this validator Reinvests your earned rewards in your staked amount, increasing potential earnings. diff --git a/features/swap/domain/models/src/main/java/com/tangem/feature/swap/domain/models/domain/ExchangeStatus.kt b/features/swap/domain/models/src/main/java/com/tangem/feature/swap/domain/models/domain/ExchangeStatus.kt index 161326f0bb..5247fa7145 100644 --- a/features/swap/domain/models/src/main/java/com/tangem/feature/swap/domain/models/domain/ExchangeStatus.kt +++ b/features/swap/domain/models/src/main/java/com/tangem/feature/swap/domain/models/domain/ExchangeStatus.kt @@ -64,4 +64,16 @@ enum class ExchangeStatus { @Json(name = "Paused") Paused, + + ; + + val isTerminal: Boolean + get() = this == Refunded || + this == Finished || + this == Cancelled || + this == TxFailed || + this == Unknown + + val isAutoDisposable: Boolean + get() = this == Finished } \ No newline at end of file diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/components/TokenDetailsDialogConfig.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/components/TokenDetailsDialogConfig.kt index ce5a9f3d49..7df750dad1 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/components/TokenDetailsDialogConfig.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/components/TokenDetailsDialogConfig.kt @@ -1,6 +1,7 @@ package com.tangem.feature.tokendetails.presentation.tokendetails.state.components import com.tangem.core.ui.extensions.TextReference +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.wrappedList import com.tangem.features.tokendetails.impl.R @@ -133,5 +134,22 @@ internal data class TokenDetailsDialogConfig( onClick = onConfirmClick, ) } + + data class ConfirmExpressStatusHideDialogConfig( + val onConfirmClick: () -> Unit, + val onCancelClick: () -> Unit, + ) : DialogContentConfig() { + override val title: TextReference = resourceReference(R.string.express_status_hide_dialog_title) + override val message: TextReference = resourceReference(R.string.express_status_hide_dialog_text) + override val confirmButtonConfig: ButtonConfig = ButtonConfig( + text = resourceReference(R.string.common_hide), + onClick = onConfirmClick, + ) + + override val cancelButtonConfig: ButtonConfig = ButtonConfig( + text = resourceReference(R.string.common_cancel), + onClick = onCancelClick, + ) + } } } \ No newline at end of file diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/express/ExchangeUM.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/express/ExchangeUM.kt index 4420f4be4a..ac23c537eb 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/express/ExchangeUM.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/express/ExchangeUM.kt @@ -15,7 +15,6 @@ internal data class ExchangeUM( val statuses: ImmutableList, val notification: ExchangeStatusNotifications? = null, val showProviderLink: Boolean, - val isRefundTerminalStatus: Boolean, val fromCryptoCurrency: CryptoCurrency, val toCryptoCurrency: CryptoCurrency, ) : ExpressTransactionStateUM \ No newline at end of file diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsOnrampTransactionStateConverter.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsOnrampTransactionStateConverter.kt index 3b8d00da73..ec6b983685 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsOnrampTransactionStateConverter.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsOnrampTransactionStateConverter.kt @@ -94,6 +94,7 @@ internal class TokenDetailsOnrampTransactionStateConverter( clickIntents.onGoToProviderClick(it) }, onClick = { clickIntents.onExpressTransactionClick(value.txId) }, + onDisposeExpressStatus = clickIntents::onConfirmDisposeExpressStatus, ), providerName = value.providerName, providerImageUrl = value.providerImageUrl, diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsStateFactory.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsStateFactory.kt index d93b495c65..e88c1cc061 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsStateFactory.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsStateFactory.kt @@ -340,6 +340,22 @@ internal class TokenDetailsStateFactory( return balanceSelectStateConverter.convert(buttonConfig) } + fun getStateWithConfirmHideExpressStatus(): TokenDetailsState { + return currentStateProvider().copy( + dialogConfig = TokenDetailsDialogConfig( + isShow = true, + onDismissRequest = clickIntents::onDismissDialog, + content = TokenDetailsDialogConfig.DialogContentConfig.ConfirmExpressStatusHideDialogConfig( + onConfirmClick = { + clickIntents.onDisposeExpressStatus() + clickIntents.onDismissDialog() + }, + onCancelClick = clickIntents::onDismissDialog, + ), + ), + ) + } + private fun TokenDetailsAppBarMenuConfig.updateMenu( cardTypesResolver: CardTypesResolver, hasDerivations: Boolean, diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsSwapTransactionsStateConverter.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsSwapTransactionsStateConverter.kt index 18fe759bac..967df9169b 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsSwapTransactionsStateConverter.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsSwapTransactionsStateConverter.kt @@ -90,7 +90,6 @@ internal class TokenDetailsSwapTransactionsStateConverter( notification = notifications, activeStatus = transaction.status?.status, showProviderLink = showProviderLink, - isRefundTerminalStatus = true, fromCryptoCurrency = fromCryptoCurrency, toCryptoCurrency = toCryptoCurrency, info = createStateInfo( @@ -107,12 +106,7 @@ internal class TokenDetailsSwapTransactionsStateConverter( return result.toPersistentList() } - fun updateTxStatus( - tx: ExchangeUM, - statusModel: ExchangeStatusModel?, - refundToken: CryptoCurrency?, - isRefundTerminalStatus: Boolean, - ): ExchangeUM { + fun updateTxStatus(tx: ExchangeUM, statusModel: ExchangeStatusModel?, refundToken: CryptoCurrency?): ExchangeUM { if (statusModel == null || tx.activeStatus == statusModel.status) { Timber.e("UpdateTxStatus isn't required. Current status isn't changed") return tx @@ -125,7 +119,6 @@ internal class TokenDetailsSwapTransactionsStateConverter( notification = notifications, statuses = getStatuses(statusModel.status, hasFailed), showProviderLink = showProviderLink, - isRefundTerminalStatus = isRefundTerminalStatus, info = tx.info.copy(txExternalUrl = statusModel.txExternalUrl), ) } @@ -164,7 +157,8 @@ internal class TokenDetailsSwapTransactionsStateConverter( }, iconState = getIconState(transaction.status?.status), status = getStatusState(), - notification = null, // fixme [REDACTED_JIRA] + notification = null, // fixme [REDACTED_JIRA], + onDisposeExpressStatus = clickIntents::onConfirmDisposeExpressStatus, ) } diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/express/ExchangeStatusFactory.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/express/ExchangeStatusFactory.kt index 25d87bd106..fc416a7196 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/express/ExchangeStatusFactory.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/express/ExchangeStatusFactory.kt @@ -79,13 +79,13 @@ internal class ExchangeStatusFactory @AssistedInject constructor( } } - suspend fun removeTransactionOnBottomSheetClosed(isForceTerminal: Boolean = false) { + suspend fun removeTransactionOnBottomSheetClosed(isForceDispose: Boolean = false) { val state = currentStateProvider() val bottomSheetConfig = state.bottomSheetConfig?.content as? ExpressStatusBottomSheetConfig ?: return val selectedTx = bottomSheetConfig.value as? ExchangeUM ?: return - val shouldTerminate = selectedTx.activeStatus.isTerminal(selectedTx.isRefundTerminalStatus) || isForceTerminal - if (shouldTerminate) { + val shouldDispose = selectedTx.activeStatus?.isAutoDisposable == true || isForceDispose + if (shouldDispose) { swapTransactionRepository.removeTransaction( userWalletId = userWalletId, fromCryptoCurrency = selectedTx.fromCryptoCurrency, @@ -96,20 +96,16 @@ internal class ExchangeStatusFactory @AssistedInject constructor( } suspend fun updateSwapTxStatus(swapTx: ExchangeUM): ExchangeUM { - return if (swapTx.activeStatus.isTerminal(swapTx.isRefundTerminalStatus)) { + return if (swapTx.activeStatus?.isTerminal == true) { swapTx } else { val statusModel = getExchangeStatus(swapTx.info.txId, swapTx.provider) - val isRefundTerminalStatus = statusModel?.refundNetwork == null && - statusModel?.refundContractAddress == null && - swapTx.provider.type != ExchangeProviderType.DEX_BRIDGE val addedRefundToken = addRefundCurrencyIfNeeded(statusModel, swapTx.provider.type) swapTransactionsStateConverter.updateTxStatus( tx = swapTx, statusModel = statusModel, refundToken = addedRefundToken, - isRefundTerminalStatus = isRefundTerminalStatus, ) } } @@ -174,15 +170,6 @@ internal class ExchangeStatusFactory @AssistedInject constructor( ) } - private fun ExchangeStatus?.isTerminal(isRefundTerminal: Boolean): Boolean { - val needTerminalRefund = this == ExchangeStatus.Refunded && isRefundTerminal - return needTerminalRefund || - this == ExchangeStatus.Finished || - this == ExchangeStatus.Cancelled || - this == ExchangeStatus.TxFailed || - this == ExchangeStatus.Unknown - } - private fun toAnalyticStatus(status: ExchangeStatus?): ExpressAnalyticsStatus? { return when (status) { ExchangeStatus.New, diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/express/ExpressStatusFactory.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/express/ExpressStatusFactory.kt index 3c1633c710..5f1c18949f 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/express/ExpressStatusFactory.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/express/ExpressStatusFactory.kt @@ -157,11 +157,13 @@ internal class ExpressStatusFactory @AssistedInject constructor( suspend fun removeTransactionOnBottomSheetClosed( expressState: ExpressTransactionStateUM, - isForceTerminal: Boolean = false, + isForceDispose: Boolean = false, ) { when (expressState) { - is ExchangeUM -> exchangeStatusFactory.removeTransactionOnBottomSheetClosed(isForceTerminal) - is ExpressTransactionStateUM.OnrampUM -> onrampStatusFactory.removeTransactionOnBottomSheetClosed() + is ExchangeUM -> exchangeStatusFactory.removeTransactionOnBottomSheetClosed(isForceDispose) + is ExpressTransactionStateUM.OnrampUM -> onrampStatusFactory.removeTransactionOnBottomSheetClosed( + isForceDispose, + ) } } diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/express/exchange/ExchangeStatusBottomSheetContent.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/express/exchange/ExchangeStatusBottomSheetContent.kt index 3c969fa8d2..f547861942 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/express/exchange/ExchangeStatusBottomSheetContent.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/express/exchange/ExchangeStatusBottomSheetContent.kt @@ -9,6 +9,7 @@ import androidx.compose.ui.Alignment.Companion.CenterHorizontally import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign import com.tangem.common.ui.expressStatus.ExpressEstimate +import com.tangem.common.ui.expressStatus.ExpressHideButton import com.tangem.common.ui.expressStatus.ExpressProvider import com.tangem.core.ui.R import com.tangem.core.ui.components.SpacerH10 @@ -70,6 +71,11 @@ internal fun ExchangeStatusBottomSheetContent(state: ExchangeUM) { if (state.notification != null) { Notification(state = state.notification, activeStatus = state.activeStatus) } + ExpressHideButton( + isTerminal = state.activeStatus?.isTerminal == true, + isAutoDisposable = state.activeStatus?.isAutoDisposable == true, + onClick = state.info.onDisposeExpressStatus, + ) SpacerH24() } } diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsClickIntents.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsClickIntents.kt index e4439079b5..8806affc45 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsClickIntents.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsClickIntents.kt @@ -72,4 +72,8 @@ interface TokenDetailsClickIntents { fun onGoToRefundedTokenClick(cryptoCurrency: CryptoCurrency) fun onOpenUrlClick(url: String) + + fun onConfirmDisposeExpressStatus() + + fun onDisposeExpressStatus() } \ No newline at end of file diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsViewModel.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsViewModel.kt index cb86b9d766..fa3df91c63 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsViewModel.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsViewModel.kt @@ -784,16 +784,7 @@ internal class TokenDetailsViewModel @Inject constructor( } override fun onGoToRefundedTokenClick(cryptoCurrency: CryptoCurrency) { - val bottomSheetState = internalUiState.value.bottomSheetConfig?.content - if (bottomSheetState is ExpressStatusBottomSheetConfig) { - viewModelScope.launch { - expressStatusFactory.removeTransactionOnBottomSheetClosed( - expressState = bottomSheetState.value, - isForceTerminal = true, - ) - } - } - internalUiState.value = stateFactory.getStateWithClosedBottomSheet() + onDisposeExpressStatus() router.openTokenDetails(userWalletId, cryptoCurrency) } @@ -950,6 +941,23 @@ internal class TokenDetailsViewModel @Inject constructor( internalUiState.value = stateFactory.getStateWithUpdatedBalanceSegmentedButtonConfig(config) } + override fun onConfirmDisposeExpressStatus() { + internalUiState.value = stateFactory.getStateWithConfirmHideExpressStatus() + } + + override fun onDisposeExpressStatus() { + val bottomSheetState = internalUiState.value.bottomSheetConfig?.content + if (bottomSheetState is ExpressStatusBottomSheetConfig) { + viewModelScope.launch { + expressStatusFactory.removeTransactionOnBottomSheetClosed( + expressState = bottomSheetState.value, + isForceDispose = true, + ) + } + } + internalUiState.value = stateFactory.getStateWithClosedBottomSheet() + } + private fun handleUnavailabilityReason( unavailabilityReason: ScenarioUnavailabilityReason, tokenSymbol: String,