diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-08-10 06:39:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-10 06:39:48 +0800 |
commit | ef7e638dda63a715c796c210dadbe82430537b6a (patch) | |
tree | 23b5b62ac378f5cc302a0d9019fba8a7c622cf04 /ui/app/components | |
parent | 0601df9dae488d997277bb6b52c28df27546e27c (diff) | |
parent | 06633da1b395829b475ccafb429af040256d863c (diff) | |
download | tangerine-wallet-browser-ef7e638dda63a715c796c210dadbe82430537b6a.tar tangerine-wallet-browser-ef7e638dda63a715c796c210dadbe82430537b6a.tar.gz tangerine-wallet-browser-ef7e638dda63a715c796c210dadbe82430537b6a.tar.bz2 tangerine-wallet-browser-ef7e638dda63a715c796c210dadbe82430537b6a.tar.lz tangerine-wallet-browser-ef7e638dda63a715c796c210dadbe82430537b6a.tar.xz tangerine-wallet-browser-ef7e638dda63a715c796c210dadbe82430537b6a.tar.zst tangerine-wallet-browser-ef7e638dda63a715c796c210dadbe82430537b6a.zip |
Merge pull request #5025 from MetaMask/v4.9.2v4.9.2.1
v4.9.2
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js | 2 | ||||
-rw-r--r-- | ui/app/components/tx-list-item.js | 8 | ||||
-rw-r--r-- | ui/app/components/tx-list.js | 18 |
3 files changed, 21 insertions, 7 deletions
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 b170880b4..961aa304e 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 @@ -124,7 +124,7 @@ export default class ConfirmTransactionBase extends Component { if (simulationFails) { return { - valid: false, + valid: true, errorKey: TRANSACTION_ERROR_KEY, } } diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js index 7513ba267..474d62638 100644 --- a/ui/app/components/tx-list-item.js +++ b/ui/app/components/tx-list-item.js @@ -35,6 +35,7 @@ function mapStateToProps (state) { currentCurrency: getCurrentCurrency(state), contractExchangeRates: state.metamask.contractExchangeRates, selectedAddressTxList: state.metamask.selectedAddressTxList, + networkNonce: state.appState.networkNonce, } } @@ -209,6 +210,7 @@ TxListItem.prototype.showRetryButton = function () { selectedAddressTxList, transactionId, txParams, + networkNonce, } = this.props if (!txParams) { return false @@ -222,11 +224,7 @@ TxListItem.prototype.showRetryButton = function () { const currentTxIsLatestWithNonce = lastSubmittedTxWithCurrentNonce && lastSubmittedTxWithCurrentNonce.id === transactionId if (currentSubmittedTxs.length > 0) { - const earliestSubmitted = currentSubmittedTxs.reduce((tx1, tx2) => { - if (tx1.submittedTime < tx2.submittedTime) return tx1 - return tx2 - }) - currentTxSharesEarliestNonce = currentNonce === earliestSubmitted.txParams.nonce + currentTxSharesEarliestNonce = currentNonce === networkNonce } return currentTxSharesEarliestNonce && currentTxIsLatestWithNonce && Date.now() - transactionSubmittedTime > 30000 diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js index 554febcff..d8c4a9d19 100644 --- a/ui/app/components/tx-list.js +++ b/ui/app/components/tx-list.js @@ -8,7 +8,7 @@ const selectors = require('../selectors') const TxListItem = require('./tx-list-item') const ShiftListItem = require('./shift-list-item') const { formatDate } = require('../util') -const { showConfTxPage } = require('../actions') +const { showConfTxPage, updateNetworkNonce } = require('../actions') const classnames = require('classnames') const { tokenInfoGetter } = require('../token-util') const { withRouter } = require('react-router-dom') @@ -28,12 +28,14 @@ function mapStateToProps (state) { return { txsToRender: selectors.transactionsSelector(state), conversionRate: selectors.conversionRateSelector(state), + selectedAddress: selectors.getSelectedAddress(state), } } function mapDispatchToProps (dispatch) { return { showConfTxPage: ({ id }) => dispatch(showConfTxPage({ id })), + updateNetworkNonce: (address) => dispatch(updateNetworkNonce(address)), } } @@ -44,6 +46,20 @@ function TxList () { TxList.prototype.componentWillMount = function () { this.tokenInfoGetter = tokenInfoGetter() + this.props.updateNetworkNonce(this.props.selectedAddress) +} + +TxList.prototype.componentDidUpdate = function (prevProps) { + const oldTxsToRender = prevProps.txsToRender + const { + txsToRender: newTxsToRender, + selectedAddress, + updateNetworkNonce, + } = this.props + + if (newTxsToRender.length > oldTxsToRender.length) { + updateNetworkNonce(selectedAddress) + } } TxList.prototype.render = function () { |