mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Show any pending txs when unlocking
Before the unlock action hard-routed to the home route, now it has a condition where it will show pending transactions instead.
This commit is contained in:
parent
46e100f595
commit
9c6ec054b1
@ -113,7 +113,6 @@ function tryUnlockMetamask(password) {
|
||||
dispatch(this.unlockFailed())
|
||||
} else {
|
||||
dispatch(this.unlockMetamask())
|
||||
dispatch(this.showAccountDetail(selectedAccount))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ const ConfirmTxScreen = require('./conf-tx')
|
||||
const ConfigScreen = require('./config')
|
||||
const InfoScreen = require('./info')
|
||||
const LoadingIndicator = require('./loading')
|
||||
const txHelper = require('../lib/tx-helper')
|
||||
|
||||
module.exports = connect(mapStateToProps)(App)
|
||||
|
||||
@ -39,6 +40,8 @@ function mapStateToProps(state) {
|
||||
activeAddress: state.appState.activeAddress,
|
||||
transForward: state.appState.transForward,
|
||||
seedWords: state.metamask.seedWords,
|
||||
unconfTxs: state.metamask.unconfTxs,
|
||||
unconfMsgs: state.metamask.unconfMsgs,
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,9 +205,21 @@ App.prototype.renderPrimary = function(state){
|
||||
return h(CreateVaultScreen, {key: 'createVault'})
|
||||
|
||||
default:
|
||||
if (this.hasPendingTxs()) {
|
||||
return h(ConfirmTxScreen, {key: 'confirm-tx'})
|
||||
} else {
|
||||
return h(AccountDetailScreen, {key: 'account-detail'})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
App.prototype.hasPendingTxs = function() {
|
||||
var state = this.props
|
||||
var unconfTxs = state.unconfTxs
|
||||
var unconfMsgs = state.unconfMsgs
|
||||
var unconfTxList = txHelper(unconfTxs, unconfMsgs)
|
||||
return unconfTxList.length > 0
|
||||
}
|
||||
|
||||
function onOffToggle(state){
|
||||
var buttonSize = '50px';
|
||||
|
@ -38,7 +38,8 @@ ConfirmTxScreen.prototype.render = function() {
|
||||
var unconfTxs = state.unconfTxs
|
||||
var unconfMsgs = state.unconfMsgs
|
||||
var unconfTxList = txHelper(unconfTxs, unconfMsgs)
|
||||
var txData = unconfTxList[state.index] || {}
|
||||
var index = state.index !== undefined ? state.index : 0
|
||||
var txData = unconfTxList[index] || {}
|
||||
|
||||
return (
|
||||
|
||||
|
@ -108,6 +108,7 @@ function reduceApp(state, action) {
|
||||
|
||||
case actions.UNLOCK_METAMASK:
|
||||
return extend(appState, {
|
||||
currentView: {},
|
||||
transForward: true,
|
||||
warning: null,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user