diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2018-02-22 02:22:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-22 02:22:19 +0800 |
commit | b8ee83e973687dffee0700dbf8e6895cf63a9ac8 (patch) | |
tree | fb8528b7bd20d272f736a74b28bd5e25cb750b67 /ui/app | |
parent | 13b12efa033a7961d59372bd53473f6251458d98 (diff) | |
parent | c26c57fad774e21fcb0b817227e9d0d99418f8a0 (diff) | |
download | tangerine-wallet-browser-b8ee83e973687dffee0700dbf8e6895cf63a9ac8.tar tangerine-wallet-browser-b8ee83e973687dffee0700dbf8e6895cf63a9ac8.tar.gz tangerine-wallet-browser-b8ee83e973687dffee0700dbf8e6895cf63a9ac8.tar.bz2 tangerine-wallet-browser-b8ee83e973687dffee0700dbf8e6895cf63a9ac8.tar.lz tangerine-wallet-browser-b8ee83e973687dffee0700dbf8e6895cf63a9ac8.tar.xz tangerine-wallet-browser-b8ee83e973687dffee0700dbf8e6895cf63a9ac8.tar.zst tangerine-wallet-browser-b8ee83e973687dffee0700dbf8e6895cf63a9ac8.zip |
Merge pull request #3296 from danjm/MM-806-new-ui-first-time-import-seed-in-popup
[NewUI] Fix Import Existing DEN in popup New UI first time flow.
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/actions.js | 1 | ||||
-rw-r--r-- | ui/app/app.js | 2 | ||||
-rw-r--r-- | ui/app/components/notice.js | 3 | ||||
-rw-r--r-- | ui/app/first-time/init-menu.js | 24 | ||||
-rw-r--r-- | ui/app/settings.js | 8 |
5 files changed, 32 insertions, 6 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 4bc1f379e..64d5b67e0 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -853,7 +853,6 @@ function markPasswordForgotten () { function unMarkPasswordForgotten () { return (dispatch) => { return background.unMarkPasswordForgotten(() => { - dispatch(actions.hideLoadingIndication()) dispatch(actions.forgotPassword()) forceUpdateMetamaskState(dispatch) }) diff --git a/ui/app/app.js b/ui/app/app.js index 1a64bb1a4..58e38a077 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -380,7 +380,7 @@ App.prototype.renderPrimary = function () { if (props.isInitialized && props.forgottenPassword) { log.debug('rendering restore vault screen') return h(HDRestoreVaultScreen, {key: 'HDRestoreVaultScreen'}) - } else if (!props.isInitialized) { + } else if (!props.isInitialized && !props.isUnlocked) { log.debug('rendering menu screen') return props.isPopup ? h(OldUIInitializeMenuScreen, {key: 'menuScreenInit'}) diff --git a/ui/app/components/notice.js b/ui/app/components/notice.js index 941ac33e6..9d2e89cb0 100644 --- a/ui/app/components/notice.js +++ b/ui/app/components/notice.js @@ -105,8 +105,7 @@ Notice.prototype.render = function () { h('button.primary', { disabled, onClick: () => { - this.setState({disclaimerDisabled: true}) - onConfirm() + this.setState({disclaimerDisabled: true}, () => onConfirm()) }, style: { marginTop: '18px', diff --git a/ui/app/first-time/init-menu.js b/ui/app/first-time/init-menu.js index b4587f1ee..0e08da8db 100644 --- a/ui/app/first-time/init-menu.js +++ b/ui/app/first-time/init-menu.js @@ -7,6 +7,8 @@ const Mascot = require('../components/mascot') const actions = require('../actions') const Tooltip = require('../components/tooltip') const getCaretCoordinates = require('textarea-caret') +const environmentType = require('../../../app/scripts/lib/environment-type') +const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/config').enums let isSubmitting = false @@ -130,6 +132,18 @@ InitializeMenuScreen.prototype.renderMenu = function (state) { }, 'Import Existing DEN'), ]), + h('.flex-row.flex-center.flex-grow', [ + h('p.pointer', { + onClick: this.showOldUI.bind(this), + style: { + fontSize: '0.8em', + color: '#aeaeae', + textDecoration: 'underline', + marginTop: '32px', + }, + }, 'Use classic interface'), + ]), + ]) ) } @@ -146,7 +160,15 @@ InitializeMenuScreen.prototype.componentDidMount = function () { } InitializeMenuScreen.prototype.showRestoreVault = function () { - this.props.dispatch(actions.showRestoreVault()) + this.props.dispatch(actions.markPasswordForgotten()) + if (environmentType() === 'popup') { + global.platform.openExtensionInBrowser() + } +} + +InitializeMenuScreen.prototype.showOldUI = function () { + this.props.dispatch(actions.setFeatureFlag('betaUI', false, 'OLD_UI_NOTIFICATION_MODAL')) + .then(() => this.props.dispatch(actions.setNetworkEndpoints(OLD_UI_NETWORK_TYPE))) } InitializeMenuScreen.prototype.createNewVaultAndKeychain = function () { diff --git a/ui/app/settings.js b/ui/app/settings.js index 988ddea8d..466f739d5 100644 --- a/ui/app/settings.js +++ b/ui/app/settings.js @@ -201,7 +201,13 @@ class Settings extends Component { h('div.settings__content-item-col', [ h('button.settings__clear-button', { onClick (event) { - exportAsFile('MetaMask State Logs', window.logState()) + window.logStateString((err, result) => { + if (err) { + this.state.dispatch(actions.displayWarning('Error in retrieving state logs.')) + } else { + exportAsFile('MetaMask State Logs.json', result) + } + }) }, }, 'Download State Logs'), ]), |