Updated on 2026-08-14

This commit is contained in:
Tangem 2025-09-05 14:42:00 +05:00
parent 974ccb2f91
commit a6323c268c
2 changed files with 21 additions and 0 deletions

View file

@ -21,6 +21,7 @@ import com.tangem.features.swap.v2.impl.choosetoken.fromSupported.model.SwapChoo
import com.tangem.features.swap.v2.impl.choosetoken.fromSupported.model.transformers.SwapChooseContentStateTransformer
import com.tangem.features.swap.v2.impl.choosetoken.fromSupported.model.transformers.SwapChooseErrorStateTransformer
import com.tangem.features.swap.v2.impl.common.SwapUtils.SEND_WITH_SWAP_PROVIDER_TYPES
import com.tangem.features.swap.v2.impl.sendviaswap.analytics.SendWithSwapAnalyticEvents
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import com.tangem.utils.transformer.update
import kotlinx.coroutines.delay
@ -97,6 +98,14 @@ internal class SwapChooseTokenNetworkModel @Inject constructor(
return@launch
}
delay(MINIMUM_LOADING_TIME)
if (pairs.fromGroup.available.isEmpty()) {
analyticsEventHandler.send(
SendWithSwapAnalyticEvents.NoticeCanNotSwapToken(
fromToken = params.initialCurrency,
toTokenSymbol = params.token.symbol,
),
)
}
uiState.update(
SwapChooseContentStateTransformer(
pairs = pairs,

View file

@ -32,4 +32,16 @@ internal sealed class SendWithSwapAnalyticEvents(
RECEIVE_BLOCKCHAIN to toToken.network.name,
),
)
data class NoticeCanNotSwapToken(
val fromToken: CryptoCurrency,
val toTokenSymbol: String,
) : SendWithSwapAnalyticEvents(
event = "Notice - Can`t Swap This Token",
params = mapOf(
SEND_TOKEN to fromToken.symbol,
RECEIVE_TOKEN to toTokenSymbol,
SEND_BLOCKCHAIN to fromToken.network.name,
),
)
}