Skip to content

Commit 67136a5

Browse files
authored
Merge pull request #692 from MetaMask/ParityFix
Improve popup behavior for tx errors
2 parents a52c497 + da611eb commit 67136a5

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Current Master
44

55
- Fix bug where chosen FIAT exchange rate does no persist when switching networks
6+
- Fix additional parameters that made MetaMask sometimes receive errors from Parity.
67

78
## 2.13.1 2016-09-23
89

app/scripts/metamask-controller.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -203,26 +203,15 @@ module.exports = class MetamaskController {
203203

204204
newUnsignedTransaction (txParams, onTxDoneCb) {
205205
const idStore = this.idStore
206-
var state = idStore.getState()
207206

208207
let err = this.enforceTxValidations(txParams)
209208
if (err) return onTxDoneCb(err)
210209

211-
// It's locked
212-
if (!state.isUnlocked) {
213-
214-
// Allow the environment to define an unlock message.
215-
this.opts.unlockAccountMessage()
216-
idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, noop)
217-
218-
// It's unlocked
219-
} else {
220-
idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => {
221-
if (err) return onTxDoneCb(err)
222-
this.sendUpdate()
223-
this.opts.showUnconfirmedTx(txParams, txData, onTxDoneCb)
224-
})
225-
}
210+
idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => {
211+
if (err) return onTxDoneCb(err)
212+
this.sendUpdate()
213+
this.opts.showUnconfirmedTx(txParams, txData, onTxDoneCb)
214+
})
226215
}
227216

228217
enforceTxValidations (txParams) {
@@ -353,4 +342,3 @@ module.exports = class MetamaskController {
353342
}
354343
}
355344

356-
function noop () {}

0 commit comments

Comments
 (0)