Updated on 2026-08-14
This commit is contained in:
parent
cc4b2e8299
commit
85ea643f3b
2 changed files with 11 additions and 6 deletions
|
|
@ -8,6 +8,7 @@ import com.tangem.tap.features.send.redux.SendScreenAction
|
|||
import com.tangem.tap.features.send.redux.states.FeeState
|
||||
import com.tangem.tap.features.send.redux.states.FeeType
|
||||
import com.tangem.tap.features.send.redux.states.SendState
|
||||
import com.tangem.tap.features.send.redux.states.TransactionExtrasState
|
||||
import com.tangem.tap.features.wallet.redux.ProgressState
|
||||
|
||||
/**
|
||||
|
|
@ -27,17 +28,21 @@ class FeeReducer : SendInternalReducer {
|
|||
state.copy(controlsLayoutIsVisible = !state.controlsLayoutIsVisible)
|
||||
}
|
||||
is FeeActionUi.ChangeSelectedFee -> {
|
||||
state.feeList?.let {
|
||||
state.fees?.let {
|
||||
val currentFee = createValueOfFeeAmount(action.feeType, it)
|
||||
state.copy(
|
||||
selectedFeeType = action.feeType,
|
||||
currentFee = currentFee,
|
||||
)
|
||||
} ?: state
|
||||
// TODO?
|
||||
}
|
||||
is FeeActionUi.ChangeIncludeFee -> state.copy(feeIsIncluded = action.isIncluded)
|
||||
}
|
||||
return updateLastState(sendState.copy(feeState = result), result)
|
||||
return updateLastState(sendState.copy(
|
||||
feeState = result,
|
||||
transactionExtrasState = TransactionExtrasState()
|
||||
), result)
|
||||
}
|
||||
|
||||
private fun handleAction(action: FeeAction, sendState: SendState, state: FeeState): SendState {
|
||||
|
|
@ -62,7 +67,7 @@ class FeeReducer : SendInternalReducer {
|
|||
|
||||
state.copy(
|
||||
selectedFeeType = feeType,
|
||||
feeList = fees,
|
||||
fees = fees,
|
||||
currentFee = currentFee,
|
||||
feeIsApproximate = isFeeApproximate(sendState),
|
||||
)
|
||||
|
|
@ -73,7 +78,7 @@ class FeeReducer : SendInternalReducer {
|
|||
|
||||
state.copy(
|
||||
selectedFeeType = feeType,
|
||||
feeList = fees,
|
||||
fees = fees,
|
||||
currentFee = currentFee,
|
||||
feeIsApproximate = isFeeApproximate(sendState),
|
||||
)
|
||||
|
|
@ -84,7 +89,7 @@ class FeeReducer : SendInternalReducer {
|
|||
}
|
||||
FeeAction.FeeCalculation.ClearResult -> {
|
||||
state.copy(
|
||||
feeList = null,
|
||||
fees = null,
|
||||
currentFee = null,
|
||||
progressState = ProgressState.Done,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ enum class FeeType {
|
|||
|
||||
data class FeeState(
|
||||
val selectedFeeType: FeeType = FeeType.NORMAL,
|
||||
val feeList: TransactionFee? = null,
|
||||
val fees: TransactionFee? = null,
|
||||
val currentFee: Amount? = null,
|
||||
val feeIsIncluded: Boolean = false,
|
||||
val feeIsApproximate: Boolean = false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue