From 2827e13caab87692aa085af380355aeb42a13bdf Mon Sep 17 00:00:00 2001 From: Esteban MIno Date: Thu, 26 Jul 2018 19:28:12 -0400 Subject: add & delete tokens per network --- ui/app/actions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/actions.js b/ui/app/actions.js index 7a8d9667d..4f71d911b 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -1483,11 +1483,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, -- cgit v1.2.3 From 0ff0a9c1976d726cb18379e3ac06a8677c928659 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Tue, 31 Jul 2018 16:02:29 -0230 Subject: Show the retry button on latest tx of earliest nonce. --- ui/app/components/tx-list-item.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui/app') 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) { -- cgit v1.2.3 From 6d76d4e228512e44e881cc91673de75e5e86798f Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Fri, 3 Aug 2018 14:44:57 -0700 Subject: Disable Confirm button on subsequent clicks to prevent confirming multiple times --- .../confirm-page-container.component.js | 6 +++--- .../confirm-transaction-base.component.js | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'ui/app') 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} /> ) 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()} -- cgit v1.2.3 From 8e3f0b42024314b395b575840563297c35aa61ba Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Fri, 3 Aug 2018 16:47:50 -0700 Subject: Update Font in Account Selector --- ui/app/components/dropdowns/components/dropdown.js | 1 - ui/app/components/dropdowns/network-dropdown.js | 3 --- ui/app/css/itcss/components/network.scss | 1 - 3 files changed, 5 deletions(-) (limited to 'ui/app') 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/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; -- cgit v1.2.3