diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-11-24 07:48:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-24 07:48:13 +0800 |
commit | b9b3ef8fedc848cbebc60eab70b90aa4f75060f2 (patch) | |
tree | 1abb0a7d44ebcf8bf81c7a0cfbb4401b45117760 | |
parent | feae6235cbe0cc6cfb4312cb6a02f246af39d5d1 (diff) | |
parent | 8dd298238de5de6b8c84bbefadd6db5c8af1adc6 (diff) | |
download | tangerine-wallet-browser-b9b3ef8fedc848cbebc60eab70b90aa4f75060f2.tar tangerine-wallet-browser-b9b3ef8fedc848cbebc60eab70b90aa4f75060f2.tar.gz tangerine-wallet-browser-b9b3ef8fedc848cbebc60eab70b90aa4f75060f2.tar.bz2 tangerine-wallet-browser-b9b3ef8fedc848cbebc60eab70b90aa4f75060f2.tar.lz tangerine-wallet-browser-b9b3ef8fedc848cbebc60eab70b90aa4f75060f2.tar.xz tangerine-wallet-browser-b9b3ef8fedc848cbebc60eab70b90aa4f75060f2.tar.zst tangerine-wallet-browser-b9b3ef8fedc848cbebc60eab70b90aa4f75060f2.zip |
Merge pull request #887 from MetaMask/i865-erabe
Modify forgot password flow to go back to init screen.
-rw-r--r-- | ui/app/actions.js | 1 | ||||
-rw-r--r-- | ui/app/app.js | 34 | ||||
-rw-r--r-- | ui/app/first-time/init-menu.js | 18 | ||||
-rw-r--r-- | ui/app/reducers/app.js | 1 | ||||
-rw-r--r-- | ui/app/unlock.js | 3 |
5 files changed, 20 insertions, 37 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index e78cf8a51..8f37b2e4c 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -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()) }) } } diff --git a/ui/app/app.js b/ui/app/app.js index 94e8adc34..9538a6b93 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -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 diff --git a/ui/app/first-time/init-menu.js b/ui/app/first-time/init-menu.js index 6ceee6784..c41aecc48 100644 --- a/ui/app/first-time/init-menu.js +++ b/ui/app/first-time/init-menu.js @@ -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 diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 27d84d8a6..1f40e90b3 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -233,6 +233,7 @@ function reduceApp (state, action) { isLoading: false, warning: null, scrollToBottom: false, + forgottenPassword: false, }) case actions.REVEAL_ACCOUNT: diff --git a/ui/app/unlock.js b/ui/app/unlock.js index ec467f483..17416766d 100644 --- a/ui/app/unlock.js +++ b/ui/app/unlock.js @@ -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, }) } - |