Updated on 2026-08-14
This commit is contained in:
parent
92be94c5f6
commit
90ae7070a1
4 changed files with 48 additions and 12 deletions
|
|
@ -105,11 +105,12 @@ internal class FeeSelectorAlertFactory @Inject constructor(
|
||||||
DialogMessage(
|
DialogMessage(
|
||||||
message = resourceReference(id = R.string.send_notification_high_fee_title),
|
message = resourceReference(id = R.string.send_notification_high_fee_title),
|
||||||
dismissOnFirstAction = true,
|
dismissOnFirstAction = true,
|
||||||
|
onDismissRequest = { stopAction() },
|
||||||
firstActionBuilder = {
|
firstActionBuilder = {
|
||||||
okAction { proceedAction(); onDismissRequest() }
|
EventMessageAction(
|
||||||
},
|
title = resourceReference(R.string.common_understand),
|
||||||
secondActionBuilder = {
|
onClick = { stopAction(); onDismissRequest() },
|
||||||
cancelAction { stopAction(); onDismissRequest() }
|
)
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@ import com.tangem.features.send.v2.api.callbacks.FeeSelectorModelCallback
|
||||||
import com.tangem.features.send.v2.api.entity.FeeNonce
|
import com.tangem.features.send.v2.api.entity.FeeNonce
|
||||||
import com.tangem.features.send.v2.api.params.FeeSelectorParams.FeeStateConfiguration
|
import com.tangem.features.send.v2.api.params.FeeSelectorParams.FeeStateConfiguration
|
||||||
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM
|
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM
|
||||||
|
import com.tangem.features.send.v2.api.subcomponents.feeSelector.FeeSelectorCheckReloadListener
|
||||||
|
import com.tangem.features.send.v2.api.subcomponents.feeSelector.FeeSelectorCheckReloadTrigger
|
||||||
import com.tangem.features.send.v2.api.subcomponents.feeSelector.FeeSelectorReloadTrigger
|
import com.tangem.features.send.v2.api.subcomponents.feeSelector.FeeSelectorReloadTrigger
|
||||||
import com.tangem.features.send.v2.api.subcomponents.notifications.SendNotificationsUpdateListener
|
import com.tangem.features.send.v2.api.subcomponents.notifications.SendNotificationsUpdateListener
|
||||||
import com.tangem.features.send.v2.api.subcomponents.notifications.SendNotificationsUpdateTrigger
|
import com.tangem.features.send.v2.api.subcomponents.notifications.SendNotificationsUpdateTrigger
|
||||||
|
|
@ -95,6 +97,8 @@ internal class SendConfirmModel @Inject constructor(
|
||||||
private val isAmountSubtractAvailableUseCase: IsAmountSubtractAvailableUseCase,
|
private val isAmountSubtractAvailableUseCase: IsAmountSubtractAvailableUseCase,
|
||||||
private val sendFeeCheckReloadTrigger: SendFeeCheckReloadTrigger,
|
private val sendFeeCheckReloadTrigger: SendFeeCheckReloadTrigger,
|
||||||
private val sendFeeCheckReloadListener: SendFeeCheckReloadListener,
|
private val sendFeeCheckReloadListener: SendFeeCheckReloadListener,
|
||||||
|
private val feeSelectorCheckReloadListener: FeeSelectorCheckReloadListener,
|
||||||
|
private val feeSelectorCheckReloadTrigger: FeeSelectorCheckReloadTrigger,
|
||||||
private val notificationsUpdateTrigger: SendNotificationsUpdateTrigger,
|
private val notificationsUpdateTrigger: SendNotificationsUpdateTrigger,
|
||||||
private val notificationsUpdateListener: SendNotificationsUpdateListener,
|
private val notificationsUpdateListener: SendNotificationsUpdateListener,
|
||||||
private val alertFactory: SendConfirmAlertFactory,
|
private val alertFactory: SendConfirmAlertFactory,
|
||||||
|
|
@ -275,7 +279,11 @@ internal class SendConfirmModel @Inject constructor(
|
||||||
verifyAndSendTransaction()
|
verifyAndSendTransaction()
|
||||||
} else {
|
} else {
|
||||||
modelScope.launch {
|
modelScope.launch {
|
||||||
sendFeeCheckReloadTrigger.triggerCheckUpdate()
|
if (uiState.value.isRedesignEnabled) {
|
||||||
|
feeSelectorCheckReloadTrigger.triggerCheckUpdate()
|
||||||
|
} else {
|
||||||
|
sendFeeCheckReloadTrigger.triggerCheckUpdate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -506,8 +514,17 @@ internal class SendConfirmModel @Inject constructor(
|
||||||
|
|
||||||
private fun subscribeOnCheckFeeResultUpdates() {
|
private fun subscribeOnCheckFeeResultUpdates() {
|
||||||
sendFeeCheckReloadListener.checkReloadResultFlow.onEach { isFeeResultSuccess ->
|
sendFeeCheckReloadListener.checkReloadResultFlow.onEach { isFeeResultSuccess ->
|
||||||
|
sendIdleTimer = SystemClock.elapsedRealtime()
|
||||||
|
if (isFeeResultSuccess) {
|
||||||
|
_uiState.update(SendConfirmSendingStateTransformer(isSending = true))
|
||||||
|
verifyAndSendTransaction()
|
||||||
|
} else {
|
||||||
|
_uiState.update(SendConfirmSendingStateTransformer(isSending = false))
|
||||||
|
}
|
||||||
|
}.launchIn(modelScope)
|
||||||
|
feeSelectorCheckReloadListener.checkReloadResultFlow.onEach { isFeeResultSuccess ->
|
||||||
|
sendIdleTimer = SystemClock.elapsedRealtime()
|
||||||
if (isFeeResultSuccess) {
|
if (isFeeResultSuccess) {
|
||||||
sendIdleTimer = SystemClock.elapsedRealtime()
|
|
||||||
_uiState.update(SendConfirmSendingStateTransformer(isSending = true))
|
_uiState.update(SendConfirmSendingStateTransformer(isSending = true))
|
||||||
verifyAndSendTransaction()
|
verifyAndSendTransaction()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents
|
||||||
import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents.SendScreenSource
|
import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents.SendScreenSource
|
||||||
import com.tangem.features.send.v2.api.callbacks.FeeSelectorModelCallback
|
import com.tangem.features.send.v2.api.callbacks.FeeSelectorModelCallback
|
||||||
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM
|
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM
|
||||||
|
import com.tangem.features.send.v2.api.subcomponents.feeSelector.FeeSelectorCheckReloadListener
|
||||||
|
import com.tangem.features.send.v2.api.subcomponents.feeSelector.FeeSelectorCheckReloadTrigger
|
||||||
import com.tangem.features.send.v2.api.subcomponents.notifications.SendNotificationsUpdateListener
|
import com.tangem.features.send.v2.api.subcomponents.notifications.SendNotificationsUpdateListener
|
||||||
import com.tangem.features.send.v2.api.subcomponents.notifications.SendNotificationsUpdateTrigger
|
import com.tangem.features.send.v2.api.subcomponents.notifications.SendNotificationsUpdateTrigger
|
||||||
import com.tangem.features.send.v2.common.CommonSendRoute
|
import com.tangem.features.send.v2.common.CommonSendRoute
|
||||||
|
|
@ -82,6 +84,8 @@ internal class NFTSendConfirmModel @Inject constructor(
|
||||||
private val notificationsUpdateListener: SendNotificationsUpdateListener,
|
private val notificationsUpdateListener: SendNotificationsUpdateListener,
|
||||||
private val sendFeeCheckReloadTrigger: SendFeeCheckReloadTrigger,
|
private val sendFeeCheckReloadTrigger: SendFeeCheckReloadTrigger,
|
||||||
private val sendFeeCheckReloadListener: SendFeeCheckReloadListener,
|
private val sendFeeCheckReloadListener: SendFeeCheckReloadListener,
|
||||||
|
private val feeSelectorCheckReloadTrigger: FeeSelectorCheckReloadTrigger,
|
||||||
|
private val feeSelectorCheckReloadListener: FeeSelectorCheckReloadListener,
|
||||||
private val alertFactory: SendConfirmAlertFactory,
|
private val alertFactory: SendConfirmAlertFactory,
|
||||||
private val urlOpener: UrlOpener,
|
private val urlOpener: UrlOpener,
|
||||||
private val shareManager: ShareManager,
|
private val shareManager: ShareManager,
|
||||||
|
|
@ -206,7 +210,11 @@ internal class NFTSendConfirmModel @Inject constructor(
|
||||||
verifyAndSendTransaction()
|
verifyAndSendTransaction()
|
||||||
} else {
|
} else {
|
||||||
modelScope.launch {
|
modelScope.launch {
|
||||||
sendFeeCheckReloadTrigger.triggerCheckUpdate()
|
if (uiState.value.isRedesignEnabled) {
|
||||||
|
feeSelectorCheckReloadTrigger.triggerCheckUpdate()
|
||||||
|
} else {
|
||||||
|
sendFeeCheckReloadTrigger.triggerCheckUpdate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -372,8 +380,17 @@ internal class NFTSendConfirmModel @Inject constructor(
|
||||||
|
|
||||||
private fun subscribeOnCheckFeeResultUpdates() {
|
private fun subscribeOnCheckFeeResultUpdates() {
|
||||||
sendFeeCheckReloadListener.checkReloadResultFlow.onEach { isFeeResultSuccess ->
|
sendFeeCheckReloadListener.checkReloadResultFlow.onEach { isFeeResultSuccess ->
|
||||||
|
sendIdleTimer = SystemClock.elapsedRealtime()
|
||||||
|
if (isFeeResultSuccess) {
|
||||||
|
_uiState.update(NFTSendConfirmSendingStateTransformer(isSending = true))
|
||||||
|
verifyAndSendTransaction()
|
||||||
|
} else {
|
||||||
|
_uiState.update(NFTSendConfirmSendingStateTransformer(isSending = false))
|
||||||
|
}
|
||||||
|
}.launchIn(modelScope)
|
||||||
|
feeSelectorCheckReloadListener.checkReloadResultFlow.onEach { isFeeResultSuccess ->
|
||||||
|
sendIdleTimer = SystemClock.elapsedRealtime()
|
||||||
if (isFeeResultSuccess) {
|
if (isFeeResultSuccess) {
|
||||||
sendIdleTimer = SystemClock.elapsedRealtime()
|
|
||||||
_uiState.update(NFTSendConfirmSendingStateTransformer(isSending = true))
|
_uiState.update(NFTSendConfirmSendingStateTransformer(isSending = true))
|
||||||
verifyAndSendTransaction()
|
verifyAndSendTransaction()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -100,11 +100,12 @@ internal class SendFeeAlertFactory @Inject constructor(
|
||||||
DialogMessage(
|
DialogMessage(
|
||||||
message = resourceReference(id = R.string.send_notification_high_fee_title),
|
message = resourceReference(id = R.string.send_notification_high_fee_title),
|
||||||
dismissOnFirstAction = true,
|
dismissOnFirstAction = true,
|
||||||
|
onDismissRequest = { stopAction() },
|
||||||
firstActionBuilder = {
|
firstActionBuilder = {
|
||||||
okAction { proceedAction(); onDismissRequest() }
|
EventMessageAction(
|
||||||
},
|
title = resourceReference(R.string.common_understand),
|
||||||
secondActionBuilder = {
|
onClick = { stopAction(); onDismissRequest() },
|
||||||
cancelAction { stopAction(); onDismissRequest() }
|
)
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue