aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-04 11:02:21 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-04 11:04:44 +0800
commitda611eb3a12a40aba09517c7c8121f9684111e0a (patch)
tree3ff41c024eea364427a14d731e35e27b9e560d86 /app/scripts
parenta52c497ad10a980ec9e84e1a9dcc5122c236bcc2 (diff)
downloadtangerine-wallet-browser-da611eb3a12a40aba09517c7c8121f9684111e0a.tar
tangerine-wallet-browser-da611eb3a12a40aba09517c7c8121f9684111e0a.tar.gz
tangerine-wallet-browser-da611eb3a12a40aba09517c7c8121f9684111e0a.tar.bz2
tangerine-wallet-browser-da611eb3a12a40aba09517c7c8121f9684111e0a.tar.lz
tangerine-wallet-browser-da611eb3a12a40aba09517c7c8121f9684111e0a.tar.xz
tangerine-wallet-browser-da611eb3a12a40aba09517c7c8121f9684111e0a.tar.zst
tangerine-wallet-browser-da611eb3a12a40aba09517c7c8121f9684111e0a.zip
Improve popup behavior for parity errors
When we receive an invalid params error, instead of opening the popup and showing no tx, we now just forward that tx back to the UI code.
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/metamask-controller.js22
1 files changed, 5 insertions, 17 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 9e1a885ae..03082013a 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -203,26 +203,15 @@ 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)
- })
- }
+ idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => {
+ if (err) return onTxDoneCb(err)
+ this.sendUpdate()
+ this.opts.showUnconfirmedTx(txParams, txData, onTxDoneCb)
+ })
}
enforceTxValidations (txParams) {
@@ -353,4 +342,3 @@ module.exports = class MetamaskController {
}
}
-function noop () {}