Merge pull request #887 from MetaMask/i865-erabe

Modify forgot password flow to go back to init screen.
feature/default_network_editable
Kevin Serrano 8 years ago committed by GitHub
commit b9b3ef8fed
  1. 1
      ui/app/actions.js
  2. 34
      ui/app/app.js
  3. 18
      ui/app/first-time/init-menu.js
  4. 1
      ui/app/reducers/app.js
  5. 3
      ui/app/unlock.js

@ -197,6 +197,7 @@ function createNewVaultAndRestore (password, seed) {
background.createNewVaultAndRestore(password, seed, (err) => { background.createNewVaultAndRestore(password, seed, (err) => {
dispatch(actions.hideLoadingIndication()) dispatch(actions.hideLoadingIndication())
if (err) return dispatch(actions.displayWarning(err.message)) if (err) return dispatch(actions.displayWarning(err.message))
dispatch(actions.showAccountsPage())
}) })
} }
} }

@ -90,7 +90,6 @@ App.prototype.render = function () {
transitionLeaveTimeout: 300, transitionLeaveTimeout: 300,
}, [ }, [
this.renderPrimary(), 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 () { App.prototype.renderPrimary = function () {
var props = this.props var props = this.props

@ -21,6 +21,7 @@ function mapStateToProps (state) {
// state from plugin // state from plugin
currentView: state.appState.currentView, currentView: state.appState.currentView,
warning: state.appState.warning, warning: state.appState.warning,
forgottenPassword: state.metamask.isInitialized,
} }
} }
@ -117,6 +118,17 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
}, },
}, 'Create'), }, '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('.flex-row.flex-center.flex-grow', [
h('p.pointer', { h('p.pointer', {
onClick: this.showRestoreVault.bind(this), onClick: this.showRestoreVault.bind(this),
@ -125,7 +137,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
color: 'rgb(247, 134, 28)', color: 'rgb(247, 134, 28)',
textDecoration: 'underline', 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()) this.props.dispatch(actions.showRestoreVault())
} }
InitializeMenuScreen.prototype.backToUnlockView = function () {
this.props.dispatch(actions.backToUnlockView())
}
InitializeMenuScreen.prototype.createNewVaultAndKeychain = function () { InitializeMenuScreen.prototype.createNewVaultAndKeychain = function () {
var passwordBox = document.getElementById('password-box') var passwordBox = document.getElementById('password-box')
var password = passwordBox.value var password = passwordBox.value

@ -233,6 +233,7 @@ function reduceApp (state, action) {
isLoading: false, isLoading: false,
warning: null, warning: null,
scrollToBottom: false, scrollToBottom: false,
forgottenPassword: false,
}) })
case actions.REVEAL_ACCOUNT: case actions.REVEAL_ACCOUNT:

@ -70,7 +70,7 @@ UnlockScreen.prototype.render = function () {
h('.flex-row.flex-center.flex-grow', [ h('.flex-row.flex-center.flex-grow', [
h('p.pointer', { h('p.pointer', {
onClick: () => this.props.dispatch(actions.showRestoreVault()), onClick: () => this.props.dispatch(actions.goBackToInitView()),
style: { style: {
fontSize: '0.8em', fontSize: '0.8em',
color: 'rgb(247, 134, 28)', color: 'rgb(247, 134, 28)',
@ -116,4 +116,3 @@ UnlockScreen.prototype.inputChanged = function (event) {
y: boundingRect.top + coordinates.top - element.scrollTop, y: boundingRect.top + coordinates.top - element.scrollTop,
}) })
} }

Loading…
Cancel
Save