From 4a407d920499e3c31244f019afc0ab20f2c8f5e3 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 25 May 2021 10:58:53 -0400 Subject: [PATCH] fix: fix not enough ETH for gas validation error on open --- ui/app/AppMain.qml | 1 + ui/shared/GasSelector.qml | 9 ++++----- ui/shared/GasValidator.qml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index c3127abc04..9329aa06df 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -287,6 +287,7 @@ RowLayout { // Add SendModal here as it is used by the Wallet as well as the Browser Loader { id: sendModal + active: false function open() { this.active = true diff --git a/ui/shared/GasSelector.qml b/ui/shared/GasSelector.qml index 5ba6c10c8c..069180d991 100644 --- a/ui/shared/GasSelector.qml +++ b/ui/shared/GasSelector.qml @@ -32,10 +32,6 @@ Item { property bool advancedMode: false - function defaultGasPrice() { - return ((50 * (root.fastestGasPrice - root.slowestGasPrice) / 100) + root.slowestGasPrice) - } - function updateGasEthValue() { // causes error on application load without this null check if (!inputGasPrice || !inputGasLimit) { @@ -48,6 +44,8 @@ Item { selectedGasFiatValue = fiatValue } + Component.onCompleted: updateGasEthValue() + function validate() { // causes error on application load without a null check if (!inputGasLimit || !inputGasPrice) { @@ -125,6 +123,7 @@ Item { onChecked: inputGasPrice.text = price } GasSelectorButton { + id: optimalGasButton buttonGroup: gasGroup checkedByDefault: true text: qsTr("Optimal") @@ -183,7 +182,7 @@ Item { anchors.right: parent.right width: 130 customHeight: 56 - text: root.defaultGasPrice() + text: optimalGasButton.price placeholderText: "20" onTextChanged: { if (root.validate()) { diff --git a/ui/shared/GasValidator.qml b/ui/shared/GasValidator.qml index 4a0492d934..210bd99fb3 100644 --- a/ui/shared/GasValidator.qml +++ b/ui/shared/GasValidator.qml @@ -24,7 +24,7 @@ Column { function validate() { let isValid = true - if (!(selectedAccount && selectedAccount.assets && selectedAsset && selectedGasEthValue > 0)) { + if (!(selectedAccount && selectedAccount.assets && selectedAsset && selectedGasEthValue >= 0)) { return root.isValid } isValid = true