Updated on 2026-08-14
This commit is contained in:
parent
bc8bb381b3
commit
c63fe7289b
1 changed files with 9 additions and 3 deletions
|
|
@ -78,11 +78,17 @@ class AmountMiddleware {
|
|||
}
|
||||
|
||||
private fun setMaxAmount(appState: AppState?, dispatch: (Action) -> Unit) {
|
||||
val amountState = appState?.sendState?.amountState ?: return
|
||||
val sendState = appState?.sendState ?: return
|
||||
|
||||
dispatch(AmountAction.SetAmount(sendState.amountState.balanceCrypto, false))
|
||||
|
||||
if (sendState.addressPayIdState.destinationWalletAddress == null || sendState.addressPayIdState.error != null) {
|
||||
// if the destination address is empty or it has an error - prevent requesting the fee
|
||||
return
|
||||
}
|
||||
|
||||
dispatch(AmountAction.SetAmount(amountState.balanceCrypto, false))
|
||||
dispatch(FeeAction.RequestFee)
|
||||
if (!amountState.isCoinAmount()) return
|
||||
if (!sendState.amountState.isCoinAmount()) return
|
||||
|
||||
dispatch(FeeAction.ChangeLayoutVisibility(main = true, controls = true, chipGroup = true))
|
||||
dispatch(FeeActionUi.ChangeIncludeFee(true))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue