mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Merge pull request #887 from MetaMask/i865-erabe
Modify forgot password flow to go back to init screen.
This commit is contained in:
commit
b9b3ef8fed
@ -197,6 +197,7 @@ function createNewVaultAndRestore (password, seed) {
|
||||
background.createNewVaultAndRestore(password, seed, (err) => {
|
||||
dispatch(actions.hideLoadingIndication())
|
||||
if (err) return dispatch(actions.displayWarning(err.message))
|
||||
dispatch(actions.showAccountsPage())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,6 @@ App.prototype.render = function () {
|
||||
transitionLeaveTimeout: 300,
|
||||
}, [
|
||||
this.renderPrimary(),
|
||||
this.renderBackToInitButton(),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
@ -337,39 +336,6 @@ App.prototype.renderBackButton = function (style, justArrow = false) {
|
||||
)
|
||||
}
|
||||
|
||||
App.prototype.renderBackToInitButton = function () {
|
||||
var props = this.props
|
||||
var button = null
|
||||
if (!props.isDisclaimerConfirmed) return button
|
||||
|
||||
if (!props.isUnlocked) {
|
||||
if (props.currentView.name === 'InitMenu') {
|
||||
button = props.forgottenPassword ? h('.flex-row', {
|
||||
key: 'rightArrow',
|
||||
style: {
|
||||
position: 'absolute',
|
||||
bottom: '10px',
|
||||
right: '15px',
|
||||
fontSize: '21px',
|
||||
fontFamily: 'Montserrat Light',
|
||||
color: '#7F8082',
|
||||
width: '77.578px',
|
||||
alignItems: 'flex-end',
|
||||
},
|
||||
}, [
|
||||
h('div.cursor-pointer', {
|
||||
style: {
|
||||
marginRight: '3px',
|
||||
},
|
||||
onClick: () => props.dispatch(actions.backToUnlockView()),
|
||||
}, 'LOGIN'),
|
||||
h('i.fa.fa-arrow-right.cursor-pointer'),
|
||||
]) : null
|
||||
}
|
||||
}
|
||||
return button
|
||||
}
|
||||
|
||||
App.prototype.renderPrimary = function () {
|
||||
var props = this.props
|
||||
|
||||
|
@ -21,6 +21,7 @@ function mapStateToProps (state) {
|
||||
// state from plugin
|
||||
currentView: state.appState.currentView,
|
||||
warning: state.appState.warning,
|
||||
forgottenPassword: state.metamask.isInitialized,
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,6 +118,17 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
|
||||
},
|
||||
}, 'Create'),
|
||||
|
||||
state.forgottenPassword ? h('.flex-row.flex-center.flex-grow', [
|
||||
h('p.pointer', {
|
||||
onClick: this.backToUnlockView.bind(this),
|
||||
style: {
|
||||
fontSize: '0.8em',
|
||||
color: 'rgb(247, 134, 28)',
|
||||
textDecoration: 'underline',
|
||||
},
|
||||
}, 'Return to Login'),
|
||||
]) : null,
|
||||
|
||||
h('.flex-row.flex-center.flex-grow', [
|
||||
h('p.pointer', {
|
||||
onClick: this.showRestoreVault.bind(this),
|
||||
@ -125,7 +137,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
|
||||
color: 'rgb(247, 134, 28)',
|
||||
textDecoration: 'underline',
|
||||
},
|
||||
}, 'I already have a DEN that I would like to import'),
|
||||
}, 'Import Existing DEN'),
|
||||
]),
|
||||
|
||||
])
|
||||
@ -147,6 +159,10 @@ InitializeMenuScreen.prototype.showRestoreVault = function () {
|
||||
this.props.dispatch(actions.showRestoreVault())
|
||||
}
|
||||
|
||||
InitializeMenuScreen.prototype.backToUnlockView = function () {
|
||||
this.props.dispatch(actions.backToUnlockView())
|
||||
}
|
||||
|
||||
InitializeMenuScreen.prototype.createNewVaultAndKeychain = function () {
|
||||
var passwordBox = document.getElementById('password-box')
|
||||
var password = passwordBox.value
|
||||
|
@ -233,6 +233,7 @@ function reduceApp (state, action) {
|
||||
isLoading: false,
|
||||
warning: null,
|
||||
scrollToBottom: false,
|
||||
forgottenPassword: false,
|
||||
})
|
||||
|
||||
case actions.REVEAL_ACCOUNT:
|
||||
|
@ -70,7 +70,7 @@ UnlockScreen.prototype.render = function () {
|
||||
|
||||
h('.flex-row.flex-center.flex-grow', [
|
||||
h('p.pointer', {
|
||||
onClick: () => this.props.dispatch(actions.showRestoreVault()),
|
||||
onClick: () => this.props.dispatch(actions.goBackToInitView()),
|
||||
style: {
|
||||
fontSize: '0.8em',
|
||||
color: 'rgb(247, 134, 28)',
|
||||
@ -116,4 +116,3 @@ UnlockScreen.prototype.inputChanged = function (event) {
|
||||
y: boundingRect.top + coordinates.top - element.scrollTop,
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user