aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-04-14 15:00:48 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-04-18 15:58:40 +0800
commitde7fc781a56fe21c01d8038b01da01fdec90f219 (patch)
tree8487256d5ec014b852b9378410aa68077ff6bc2b /ui
parent1c892670de61119f4e06f55a0dc6a1beb3c669b5 (diff)
downloadtangerine-wallet-browser-de7fc781a56fe21c01d8038b01da01fdec90f219.tar
tangerine-wallet-browser-de7fc781a56fe21c01d8038b01da01fdec90f219.tar.gz
tangerine-wallet-browser-de7fc781a56fe21c01d8038b01da01fdec90f219.tar.bz2
tangerine-wallet-browser-de7fc781a56fe21c01d8038b01da01fdec90f219.tar.lz
tangerine-wallet-browser-de7fc781a56fe21c01d8038b01da01fdec90f219.tar.xz
tangerine-wallet-browser-de7fc781a56fe21c01d8038b01da01fdec90f219.tar.zst
tangerine-wallet-browser-de7fc781a56fe21c01d8038b01da01fdec90f219.zip
Fix BigNumber exception in confirm-send-ether
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/pending-tx/index.js28
1 files changed, 25 insertions, 3 deletions
diff --git a/ui/app/components/pending-tx/index.js b/ui/app/components/pending-tx/index.js
index acdd99364..dc496a8d8 100644
--- a/ui/app/components/pending-tx/index.js
+++ b/ui/app/components/pending-tx/index.js
@@ -1,6 +1,7 @@
const Component = require('react').Component
const connect = require('react-redux').connect
const h = require('react-hyperscript')
+const PropTypes = require('prop-types')
const clone = require('clone')
const abi = require('human-standard-token-abi')
const abiDecoder = require('abi-decoder')
@@ -11,6 +12,7 @@ const util = require('../../util')
const ConfirmSendEther = require('./confirm-send-ether')
const ConfirmSendToken = require('./confirm-send-token')
const ConfirmDeployContract = require('./confirm-deploy-contract')
+const Loading = require('../loading')
const TX_TYPES = {
DEPLOY_CONTRACT: 'deploy_contract',
@@ -53,10 +55,24 @@ function PendingTx () {
}
}
-PendingTx.prototype.componentWillMount = async function () {
+PendingTx.prototype.componentDidMount = function () {
+ this.setTokenData()
+}
+
+PendingTx.prototype.componentDidUpdate = function (prevProps, prevState) {
+ if (prevState.isFetching) {
+ this.setTokenData()
+ }
+}
+
+PendingTx.prototype.setTokenData = async function () {
const txMeta = this.gatherTxMeta()
const txParams = txMeta.txParams || {}
+ if (txMeta.loadingDefaults) {
+ return
+ }
+
if (!txParams.to) {
return this.setState({
transactionType: TX_TYPES.DEPLOY_CONTRACT,
@@ -125,7 +141,9 @@ PendingTx.prototype.render = function () {
const { sendTransaction } = this.props
if (isFetching) {
- return h('noscript')
+ return h(Loading, {
+ loadingMessage: this.context.t('estimatingTransaction'),
+ })
}
switch (transactionType) {
@@ -150,6 +168,10 @@ PendingTx.prototype.render = function () {
sendTransaction,
})
default:
- return h('noscript')
+ return h(Loading)
}
}
+
+PendingTx.contextTypes = {
+ t: PropTypes.func,
+}