Display newest transaction

feature/default_network_editable
Alexander Tseung 7 years ago
parent e89549846f
commit 7732cd4100
  1. 2
      app/scripts/controllers/transactions/index.js
  2. 3
      ui/app/components/app-header/app-header.component.js
  3. 5
      ui/app/components/pages/confirm-transaction/confirm-transaction.component.js
  4. 2
      ui/app/ducks/confirm-transaction.duck.js

@ -157,7 +157,6 @@ class TransactionController extends EventEmitter {
// construct txMeta // construct txMeta
let txMeta = this.txStateManager.generateTxMeta({ txParams: normalizedTxParams }) let txMeta = this.txStateManager.generateTxMeta({ txParams: normalizedTxParams })
this.addTx(txMeta) this.addTx(txMeta)
this.emit('newUnapprovedTx', txMeta)
try { try {
// check whether recipient account is blacklisted // check whether recipient account is blacklisted
@ -172,6 +171,7 @@ class TransactionController extends EventEmitter {
txMeta.loadingDefaults = false txMeta.loadingDefaults = false
// save txMeta // save txMeta
this.txStateManager.updateTx(txMeta) this.txStateManager.updateTx(txMeta)
this.emit('newUnapprovedTx', txMeta)
return txMeta return txMeta
} }

@ -91,7 +91,6 @@ class AppHeader extends Component {
network, network,
provider, provider,
history, history,
location,
isUnlocked, isUnlocked,
} = this.props } = this.props
@ -126,7 +125,7 @@ class AppHeader extends Component {
network={network} network={network}
provider={provider} provider={provider}
onClick={event => this.handleNetworkIndicatorClick(event)} onClick={event => this.handleNetworkIndicatorClick(event)}
disabled={location.pathname === CONFIRM_TRANSACTION_ROUTE} disabled={this.isConfirming()}
/> />
</div> </div>
{ this.renderAccountMenu() } { this.renderAccountMenu() }

@ -61,7 +61,7 @@ export default class ConfirmTransaction extends Component {
setTransactionToConfirm(paramsTransactionId) setTransactionToConfirm(paramsTransactionId)
} }
if (!paramsTransactionId) { if (!transactionId) {
this.setTransactionToConfirm() this.setTransactionToConfirm()
} }
} }
@ -84,7 +84,8 @@ export default class ConfirmTransaction extends Component {
setTransactionToConfirm(paramsTransactionId) setTransactionToConfirm(paramsTransactionId)
} }
} else if (unconfirmedTransactions.length) { } else if (unconfirmedTransactions.length) {
const transactionId = unconfirmedTransactions[0].id const totalUnconfirmed = unconfirmedTransactions.length
const transactionId = unconfirmedTransactions[totalUnconfirmed - 1].id
setTransactionToConfirm(transactionId) setTransactionToConfirm(transactionId)
} }
} }

@ -236,7 +236,7 @@ export function updateTxDataAndCalculate (txData) {
dispatch(updateTxData(txData)) dispatch(updateTxData(txData))
const { txParams: { value, gas: gasLimit, gasPrice } = {} } = txData const { txParams: { value, gas: gasLimit = '0x0', gasPrice = '0x0' } = {} } = txData
const fiatTransactionAmount = getTransactionAmount({ const fiatTransactionAmount = getTransactionAmount({
value, toCurrency: currentCurrency, conversionRate, numberOfDecimals: 2, value, toCurrency: currentCurrency, conversionRate, numberOfDecimals: 2,

Loading…
Cancel
Save