Updated on 2026-08-14
This commit is contained in:
commit
97f3ed2dc4
7 changed files with 22 additions and 3 deletions
|
|
@ -18,6 +18,7 @@ internal sealed class WalletConnect(
|
|||
AnalyticsParam.SOURCE to when (source) {
|
||||
SourceType.QR -> "QR"
|
||||
SourceType.DEEPLINK -> "DeepLink"
|
||||
SourceType.CLIPBOARD -> "Clipboard"
|
||||
SourceType.ETC -> "etc"
|
||||
},
|
||||
),
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ internal class DefaultLegacyWalletConnectRepository(
|
|||
val session = currentSessions.find { it.topic == requestData.topic }
|
||||
|
||||
analyticsHandler.send(
|
||||
WalletConnect.SignatureRequestHandled(
|
||||
WalletConnect.SignatureRequestFailed(
|
||||
WalletConnect.RequestHandledParams(
|
||||
dAppName = session?.name ?: "",
|
||||
dAppUrl = session?.url ?: "",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ sealed class WalletConnectAction : Action {
|
|||
val wcUri: String,
|
||||
val source: SourceType,
|
||||
) : WalletConnectAction() {
|
||||
enum class SourceType { QR, DEEPLINK, ETC }
|
||||
enum class SourceType { QR, DEEPLINK, CLIPBOARD, ETC }
|
||||
}
|
||||
|
||||
data class DisconnectSession(val topic: String) : WalletConnectAction()
|
||||
|
|
|
|||
|
|
@ -512,6 +512,20 @@ internal class SendModel @Inject constructor(
|
|||
|
||||
override fun onNextClick(isFromEdit: Boolean) {
|
||||
val currentState = stateRouter.currentState.value
|
||||
when (currentState.type) {
|
||||
SendUiStateType.Fee,
|
||||
SendUiStateType.EditFee,
|
||||
-> if (uiState.value.feeState?.isPrimaryButtonEnabled == false) return
|
||||
SendUiStateType.Amount,
|
||||
SendUiStateType.EditAmount,
|
||||
-> if (!uiState.value.amountState.isPrimaryButtonEnabled) return
|
||||
SendUiStateType.Recipient,
|
||||
SendUiStateType.EditRecipient,
|
||||
-> if (uiState.value.recipientState?.isPrimaryButtonEnabled == false) return
|
||||
SendUiStateType.Send -> if (uiState.value.sendState?.isPrimaryButtonEnabled == false) return
|
||||
SendUiStateType.None -> return
|
||||
}
|
||||
|
||||
uiState.value = stateFactory.syncEditStates(isFromEdit = isFromEdit)
|
||||
sendScreenAnalyticSender.send(currentState.type, uiState.value)
|
||||
when (currentState.type) {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ internal class AmountChangeStateTransformer(
|
|||
return prevState.copy(
|
||||
amountState = AmountRequirementStateTransformer(
|
||||
cryptoCurrencyStatus = cryptoCurrencyStatus,
|
||||
maxAmount = maxEnterAmount,
|
||||
yield = yield,
|
||||
actionType = prevState.actionType,
|
||||
).transform(updatedAmountState),
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ internal class AmountMaxValueStateTransformer(
|
|||
).transform(prevState.amountState)
|
||||
return prevState.copy(
|
||||
amountState = AmountRequirementStateTransformer(
|
||||
maxAmount = maxEnterAmount,
|
||||
cryptoCurrencyStatus = cryptoCurrencyStatus,
|
||||
yield = yield,
|
||||
actionType = prevState.actionType,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import androidx.annotation.StringRes
|
|||
import androidx.compose.ui.text.input.ImeAction
|
||||
import com.tangem.common.extensions.isZero
|
||||
import com.tangem.common.ui.amountScreen.models.AmountState
|
||||
import com.tangem.common.ui.amountScreen.models.EnterAmountBoundary
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.wrappedList
|
||||
|
|
@ -24,6 +25,7 @@ import java.math.RoundingMode
|
|||
|
||||
internal class AmountRequirementStateTransformer(
|
||||
private val cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
private val maxAmount: EnterAmountBoundary,
|
||||
private val yield: Yield,
|
||||
private val actionType: StakingActionCommonType,
|
||||
) : Transformer<AmountState> {
|
||||
|
|
@ -121,7 +123,7 @@ internal class AmountRequirementStateTransformer(
|
|||
val isExceedsMaxRequirement = if (maximum?.isPositive() == true) {
|
||||
maximum?.compareTo(amount) == -1
|
||||
} else {
|
||||
cryptoCurrencyStatus.value.amount?.compareTo(amount) == -1
|
||||
maxAmount.amount?.compareTo(amount) == -1
|
||||
}
|
||||
|
||||
val errorText = when {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue