aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send.component.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/send_/send.component.js')
-rw-r--r--ui/app/components/send_/send.component.js37
1 files changed, 19 insertions, 18 deletions
diff --git a/ui/app/components/send_/send.component.js b/ui/app/components/send_/send.component.js
index 8b0a41f9e..21e1de09b 100644
--- a/ui/app/components/send_/send.component.js
+++ b/ui/app/components/send_/send.component.js
@@ -83,30 +83,31 @@ export default class SendTransactionScreen extends PersistentForm {
const uninitialized = [prevBalance, prevGasTotal].every(n => n === null)
- if (!uninitialized) {
- const amountErrorRequiresUpdate = doesAmountErrorRequireUpdate({
+ const amountErrorRequiresUpdate = doesAmountErrorRequireUpdate({
+ balance,
+ gasTotal,
+ prevBalance,
+ prevGasTotal,
+ prevTokenBalance,
+ selectedToken,
+ tokenBalance,
+ })
+
+ if (amountErrorRequiresUpdate) {
+ const amountErrorObject = getAmountErrorObject({
+ amount,
+ amountConversionRate,
balance,
+ conversionRate,
gasTotal,
- prevBalance,
- prevGasTotal,
- prevTokenBalance,
+ primaryCurrency,
selectedToken,
tokenBalance,
})
+ updateSendErrors(amountErrorObject)
+ }
- if (amountErrorRequiresUpdate) {
- const amountErrorObject = getAmountErrorObject({
- amount,
- amountConversionRate,
- balance,
- conversionRate,
- gasTotal,
- primaryCurrency,
- selectedToken,
- tokenBalance,
- })
- updateSendErrors(amountErrorObject)
- }
+ if (!uninitialized) {
if (network !== prevNetwork && network !== 'loading') {
updateSendTokenBalance({