From 90f4831a2077247072a9b755f41e3453a2cc5038 Mon Sep 17 00:00:00 2001 From: Amin <32006742+aminsato@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:29:59 +0330 Subject: [PATCH] Fix ETH gas limit text state (#1405) * Save ETH gas limit text state * Reformat --- .../wallet/ui/models/send/GasSettingsViewModel.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/vultisig/wallet/ui/models/send/GasSettingsViewModel.kt b/app/src/main/java/com/vultisig/wallet/ui/models/send/GasSettingsViewModel.kt index ab296e7f2..d1ae740eb 100644 --- a/app/src/main/java/com/vultisig/wallet/ui/models/send/GasSettingsViewModel.kt +++ b/app/src/main/java/com/vultisig/wallet/ui/models/send/GasSettingsViewModel.kt @@ -123,9 +123,11 @@ internal class GasSettingsViewModel @Inject constructor( } private fun loadEthData(chain: Chain, spec: BlockChainSpecificAndUtxo){ - val specific = spec.blockChainSpecific as BlockChainSpecific.Ethereum - - val gasLimit = specific.gasLimit + val gasLimit = if (gasLimitState.text.isEmpty()) { + (spec.blockChainSpecific as BlockChainSpecific.Ethereum).gasLimit + } else { + gasLimitState.text.toString().toBigInteger() + } gasLimitState.setTextAndPlaceCursorAtEnd(gasLimit.toString())