From 2c8156ebe91941309d49e8f8f1ed8e9d740bb9de Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Wed, 18 Apr 2018 00:31:33 -0700 Subject: Fix UI getting stuck in Reveal Seed screen --- mascara/src/app/first-time/confirm-seed-screen.js | 14 ++++- mascara/src/app/first-time/seed-screen.js | 71 +++++++++++++++++------ 2 files changed, 66 insertions(+), 19 deletions(-) (limited to 'mascara/src') diff --git a/mascara/src/app/first-time/confirm-seed-screen.js b/mascara/src/app/first-time/confirm-seed-screen.js index 438f383b1..7c0431431 100644 --- a/mascara/src/app/first-time/confirm-seed-screen.js +++ b/mascara/src/app/first-time/confirm-seed-screen.js @@ -9,7 +9,7 @@ import Identicon from '../../../../ui/app/components/identicon' import { confirmSeedWords, showModal } from '../../../../ui/app/actions' import Breadcrumbs from './breadcrumbs' import LoadingScreen from './loading-screen' -import { DEFAULT_ROUTE } from '../../../../ui/app/routes' +import { DEFAULT_ROUTE, INITIALIZE_BACKUP_PHRASE_ROUTE } from '../../../../ui/app/routes' class ConfirmSeedScreen extends Component { static propTypes = { @@ -53,7 +53,7 @@ class ConfirmSeedScreen extends Component { } render () { - const { seedWords } = this.props + const { seedWords, history } = this.props const { selectedSeeds, shuffledSeeds } = this.state const isValid = seedWords === selectedSeeds.map(([_, seed]) => seed).join(' ') @@ -66,6 +66,16 @@ class ConfirmSeedScreen extends Component {
+ { + e.preventDefault() + history.push(INITIALIZE_BACKUP_PHRASE_ROUTE) + }} + href="#" + > + {`< Back`} +
diff --git a/mascara/src/app/first-time/seed-screen.js b/mascara/src/app/first-time/seed-screen.js index d004be77b..9af9ca3be 100644 --- a/mascara/src/app/first-time/seed-screen.js +++ b/mascara/src/app/first-time/seed-screen.js @@ -8,6 +8,7 @@ import Identicon from '../../../../ui/app/components/identicon' import Breadcrumbs from './breadcrumbs' import LoadingScreen from './loading-screen' import { DEFAULT_ROUTE, INITIALIZE_CONFIRM_SEED_ROUTE } from '../../../../ui/app/routes' +import { confirmSeedWords } from '../../../../ui/app/actions' const LockIcon = props => ( clearSeedWords().then(() => history.push(DEFAULT_ROUTE))} + disabled={!isShowingSecret} + > + Done + + : + } + + renderSecretScreen () { + const { isRevealingSeedWords } = this.props return (
@@ -121,14 +152,8 @@ class BackupPhraseScreen extends Component {
- - + { this.renderSubmitButton() } + { !isRevealingSeedWords && }
) @@ -150,13 +175,25 @@ class BackupPhraseScreen extends Component { } } +const mapStateToProps = ({ metamask, appState }) => { + const { selectedAddress, seedWords, isRevealingSeedWords } = metamask + const { isLoading } = appState + + return { + seedWords, + isRevealingSeedWords, + isLoading, + address: selectedAddress, + } +} + +const mapDispatchToProps = dispatch => { + return { + clearSeedWords: () => dispatch(confirmSeedWords()), + } +} + export default compose( withRouter, - connect( - ({ metamask: { selectedAddress, seedWords }, appState: { isLoading } }) => ({ - seedWords, - isLoading, - address: selectedAddress, - }) - ) + connect(mapStateToProps, mapDispatchToProps), )(BackupPhraseScreen) -- cgit v1.2.3