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())
|
dispatch(this.unlockFailed())
|
||||||
} else {
|
} else {
|
||||||
dispatch(this.unlockMetamask())
|
dispatch(this.unlockMetamask())
|
||||||
dispatch(this.showAccountDetail(selectedAccount))
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ const ConfirmTxScreen = require('./conf-tx')
|
|||||||
const ConfigScreen = require('./config')
|
const ConfigScreen = require('./config')
|
||||||
const InfoScreen = require('./info')
|
const InfoScreen = require('./info')
|
||||||
const LoadingIndicator = require('./loading')
|
const LoadingIndicator = require('./loading')
|
||||||
|
const txHelper = require('../lib/tx-helper')
|
||||||
|
|
||||||
module.exports = connect(mapStateToProps)(App)
|
module.exports = connect(mapStateToProps)(App)
|
||||||
|
|
||||||
@ -39,6 +40,8 @@ function mapStateToProps(state) {
|
|||||||
activeAddress: state.appState.activeAddress,
|
activeAddress: state.appState.activeAddress,
|
||||||
transForward: state.appState.transForward,
|
transForward: state.appState.transForward,
|
||||||
seedWords: state.metamask.seedWords,
|
seedWords: state.metamask.seedWords,
|
||||||
|
unconfTxs: state.metamask.unconfTxs,
|
||||||
|
unconfMsgs: state.metamask.unconfMsgs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,8 +205,20 @@ App.prototype.renderPrimary = function(state){
|
|||||||
return h(CreateVaultScreen, {key: 'createVault'})
|
return h(CreateVaultScreen, {key: 'createVault'})
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return h(AccountDetailScreen, {key: 'account-detail'})
|
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){
|
function onOffToggle(state){
|
||||||
|
@ -38,7 +38,8 @@ ConfirmTxScreen.prototype.render = function() {
|
|||||||
var unconfTxs = state.unconfTxs
|
var unconfTxs = state.unconfTxs
|
||||||
var unconfMsgs = state.unconfMsgs
|
var unconfMsgs = state.unconfMsgs
|
||||||
var unconfTxList = txHelper(unconfTxs, unconfMsgs)
|
var unconfTxList = txHelper(unconfTxs, unconfMsgs)
|
||||||
var txData = unconfTxList[state.index] || {}
|
var index = state.index !== undefined ? state.index : 0
|
||||||
|
var txData = unconfTxList[index] || {}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
@ -108,6 +108,7 @@ function reduceApp(state, action) {
|
|||||||
|
|
||||||
case actions.UNLOCK_METAMASK:
|
case actions.UNLOCK_METAMASK:
|
||||||
return extend(appState, {
|
return extend(appState, {
|
||||||
|
currentView: {},
|
||||||
transForward: true,
|
transForward: true,
|
||||||
warning: null,
|
warning: null,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user