From 82ed67f02b59b2662dfe143379518a8ee13b0309 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 20 Jun 2018 12:35:29 +0200 Subject: [PATCH] Fix tx invalid (#58) --- packages/light-react/src/stores/sendStore.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/light-react/src/stores/sendStore.js b/packages/light-react/src/stores/sendStore.js index 72f66fc3..abb1b4e2 100644 --- a/packages/light-react/src/stores/sendStore.js +++ b/packages/light-react/src/stores/sendStore.js @@ -102,18 +102,12 @@ class SendStore { @computed get isTxValid () { - // The address should be okay - if (!this.tx || !isAddress(this.tx.to)) { - return false; - } - - // The amount should be a number - if (!Number.isFinite(this.tx.amount)) { - return false; - } - - // The gasPrice should be a number - if (!Number.isFinite(this.tx.gasPrice)) { + if ( + !this.tx || // There should be a tx + !isAddress(this.tx.to) || // The address should be okay + isNaN(this.tx.amount) || + isNaN(this.tx.gasPrice) + ) { return false; } -- GitLab