diff options
Merge branch 'develop' into WatchTokenFeature
Diffstat (limited to 'ui/app')
7 files changed, 27 insertions, 16 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 04ad344cf..5cc7dc2fa 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -1486,11 +1486,12 @@ function showAccountDetail (address) { return (dispatch) => { dispatch(actions.showLoadingIndication()) log.debug(`background.setSelectedAddress`) - background.setSelectedAddress(address, (err) => { + background.setSelectedAddress(address, (err, tokens) => { dispatch(actions.hideLoadingIndication()) if (err) { return dispatch(actions.displayWarning(err.message)) } + dispatch(updateTokens(tokens)) dispatch({ type: actions.SHOW_ACCOUNT_DETAIL, value: address, diff --git a/ui/app/components/confirm-page-container/confirm-page-container.component.js b/ui/app/components/confirm-page-container/confirm-page-container.component.js index 93e4ae7bf..24ff05353 100644 --- a/ui/app/components/confirm-page-container/confirm-page-container.component.js +++ b/ui/app/components/confirm-page-container/confirm-page-container.component.js @@ -43,7 +43,7 @@ export default class ConfirmPageContainer extends Component { // Footer onCancel: PropTypes.func, onSubmit: PropTypes.func, - valid: PropTypes.bool, + disabled: PropTypes.bool, } render () { @@ -54,7 +54,7 @@ export default class ConfirmPageContainer extends Component { fromAddress, toName, toAddress, - valid, + disabled, errorKey, errorMessage, contentComponent, @@ -110,7 +110,7 @@ export default class ConfirmPageContainer extends Component { onSubmit={() => onSubmit()} submitText={this.context.t('confirm')} submitButtonType="confirm" - disabled={!valid} + disabled={disabled} /> </div> ) diff --git a/ui/app/components/dropdowns/components/dropdown.js b/ui/app/components/dropdowns/components/dropdown.js index 0336dbb8b..149f063a7 100644 --- a/ui/app/components/dropdowns/components/dropdown.js +++ b/ui/app/components/dropdowns/components/dropdown.js @@ -87,7 +87,6 @@ class DropdownMenuItem extends Component { padding: '8px 0px', fontSize: '18px', fontStyle: 'normal', - fontFamily: 'Montserrat Regular', cursor: 'pointer', display: 'flex', justifyContent: 'flex-start', diff --git a/ui/app/components/dropdowns/network-dropdown.js b/ui/app/components/dropdowns/network-dropdown.js index dcd6b4370..e5363ff56 100644 --- a/ui/app/components/dropdowns/network-dropdown.js +++ b/ui/app/components/dropdowns/network-dropdown.js @@ -71,7 +71,6 @@ NetworkDropdown.prototype.render = function () { const rpcList = props.frequentRpcList const isOpen = this.props.networkDropdownOpen const dropdownMenuItemStyle = { - fontFamily: 'DIN OT', fontSize: '16px', lineHeight: '20px', padding: '12px 0', @@ -286,7 +285,6 @@ NetworkDropdown.prototype.renderCommonRpc = function (rpcList, provider) { closeMenu: () => this.props.hideNetworkDropdown(), onClick: () => props.setRpcTarget(rpc), style: { - fontFamily: 'DIN OT', fontSize: '16px', lineHeight: '20px', padding: '12px 0', @@ -325,7 +323,6 @@ NetworkDropdown.prototype.renderCustomOption = function (provider) { onClick: () => props.setRpcTarget(rpcTarget), closeMenu: () => this.props.hideNetworkDropdown(), style: { - fontFamily: 'DIN OT', fontSize: '16px', lineHeight: '20px', padding: '12px 0', diff --git a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js index e1bf2210f..b170880b4 100644 --- a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -71,6 +71,10 @@ export default class ConfirmTransactionBase extends Component { warning: PropTypes.string, } + state = { + submitting: false, + } + componentDidUpdate () { const { transactionStatus, @@ -258,15 +262,25 @@ export default class ConfirmTransactionBase extends Component { handleSubmit () { const { sendTransaction, clearConfirmTransaction, txData, history, onSubmit } = this.props + const { submitting } = this.state + + if (submitting) { + return + } + + this.setState({ submitting: true }) if (onSubmit) { - onSubmit(txData) + Promise.resolve(onSubmit(txData)) + .then(this.setState({ submitting: false })) } else { sendTransaction(txData) .then(() => { clearConfirmTransaction() + this.setState({ submitting: false }) history.push(DEFAULT_ROUTE) }) + .catch(() => this.setState({ submitting: false })) } } @@ -280,7 +294,7 @@ export default class ConfirmTransactionBase extends Component { methodData, ethTransactionAmount, fiatTransactionAmount, - valid: propsValid, + valid: propsValid = true, errorMessage, errorKey: propsErrorKey, currentCurrency, @@ -295,6 +309,7 @@ export default class ConfirmTransactionBase extends Component { nonce, warning, } = this.props + const { submitting } = this.state const { name } = methodData const fiatConvertedAmount = formatCurrency(fiatTransactionAmount, currentCurrency) @@ -320,7 +335,7 @@ export default class ConfirmTransactionBase extends Component { errorMessage={errorMessage} errorKey={propsErrorKey || errorKey} warning={warning} - valid={propsValid || valid} + disabled={!propsValid || !valid || submitting} onEdit={() => this.handleEdit()} onCancel={() => this.handleCancel()} onSubmit={() => this.handleSubmit()} diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js index 1a639d0b9..7513ba267 100644 --- a/ui/app/components/tx-list-item.js +++ b/ui/app/components/tx-list-item.js @@ -213,7 +213,7 @@ TxListItem.prototype.showRetryButton = function () { if (!txParams) { return false } - let currentTxIsLatest = false + let currentTxSharesEarliestNonce = false const currentNonce = txParams.nonce const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce) const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted') @@ -222,14 +222,14 @@ TxListItem.prototype.showRetryButton = function () { const currentTxIsLatestWithNonce = lastSubmittedTxWithCurrentNonce && lastSubmittedTxWithCurrentNonce.id === transactionId if (currentSubmittedTxs.length > 0) { - const lastTx = currentSubmittedTxs.reduce((tx1, tx2) => { + const earliestSubmitted = currentSubmittedTxs.reduce((tx1, tx2) => { if (tx1.submittedTime < tx2.submittedTime) return tx1 return tx2 }) - currentTxIsLatest = lastTx.id === transactionId + currentTxSharesEarliestNonce = currentNonce === earliestSubmitted.txParams.nonce } - return currentTxIsLatestWithNonce && Date.now() - transactionSubmittedTime > 30000 && currentTxIsLatest + return currentTxSharesEarliestNonce && currentTxIsLatestWithNonce && Date.now() - transactionSubmittedTime > 30000 } TxListItem.prototype.setSelectedToken = function (tokenAddress) { diff --git a/ui/app/css/itcss/components/network.scss b/ui/app/css/itcss/components/network.scss index 545a2a940..b23876d01 100644 --- a/ui/app/css/itcss/components/network.scss +++ b/ui/app/css/itcss/components/network.scss @@ -76,7 +76,6 @@ } .network-name-item { - font-weight: 100; flex: 1; color: $dusty-gray; text-overflow: ellipsis; |