mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Merge pull request #692 from MetaMask/ParityFix
Improve popup behavior for tx errors
This commit is contained in:
commit
67136a54b2
@ -3,6 +3,7 @@
|
||||
## Current Master
|
||||
|
||||
- Fix bug where chosen FIAT exchange rate does no persist when switching networks
|
||||
- Fix additional parameters that made MetaMask sometimes receive errors from Parity.
|
||||
|
||||
## 2.13.1 2016-09-23
|
||||
|
||||
|
@ -203,27 +203,16 @@ module.exports = class MetamaskController {
|
||||
|
||||
newUnsignedTransaction (txParams, onTxDoneCb) {
|
||||
const idStore = this.idStore
|
||||
var state = idStore.getState()
|
||||
|
||||
let err = this.enforceTxValidations(txParams)
|
||||
if (err) return onTxDoneCb(err)
|
||||
|
||||
// It's locked
|
||||
if (!state.isUnlocked) {
|
||||
|
||||
// Allow the environment to define an unlock message.
|
||||
this.opts.unlockAccountMessage()
|
||||
idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, noop)
|
||||
|
||||
// It's unlocked
|
||||
} else {
|
||||
idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => {
|
||||
if (err) return onTxDoneCb(err)
|
||||
this.sendUpdate()
|
||||
this.opts.showUnconfirmedTx(txParams, txData, onTxDoneCb)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
enforceTxValidations (txParams) {
|
||||
if (('value' in txParams) && txParams.value.indexOf('-') === 0) {
|
||||
@ -353,4 +342,3 @@ module.exports = class MetamaskController {
|
||||
}
|
||||
}
|
||||
|
||||
function noop () {}
|
||||
|
Loading…
Reference in New Issue
Block a user