diff --git a/mascara/src/app/first-time/backup-phrase-screen.js b/mascara/src/app/first-time/backup-phrase-screen.js
index c68dacea2..266a82cdb 100644
--- a/mascara/src/app/first-time/backup-phrase-screen.js
+++ b/mascara/src/app/first-time/backup-phrase-screen.js
@@ -1,5 +1,6 @@
-import React, {Component, PropTypes} from 'react'
-import {connect} from 'react-redux';
+import React, { Component } from 'react'
+import PropTypes from 'prop-types'
+import {connect} from 'react-redux'
import classnames from 'classnames'
import shuffle from 'lodash.shuffle'
import {compose, onlyUpdateForPropTypes} from 'recompose'
@@ -7,6 +8,7 @@ import Identicon from '../../../../ui/app/components/identicon'
import {confirmSeedWords} from '../../../../ui/app/actions'
import Breadcrumbs from './breadcrumbs'
import LoadingScreen from './loading-screen'
+import { DEFAULT_ROUTE } from '../../../../ui/app/routes'
const LockIcon = props => (
-);
+)
class BackupPhraseScreen extends Component {
static propTypes = {
isLoading: PropTypes.bool.isRequired,
address: PropTypes.string.isRequired,
- seedWords: PropTypes.string.isRequired,
- next: PropTypes.func.isRequired,
+ seedWords: PropTypes.string,
confirmSeedWords: PropTypes.func.isRequired,
+ history: PropTypes.object,
};
static defaultProps = {
- seedWords: ''
- };
+ seedWords: '',
+ }
static PAGE = {
SECRET: 'secret',
- CONFIRM: 'confirm'
- };
+ CONFIRM: 'confirm',
+ }
- constructor(props) {
+ constructor (props) {
const {seedWords} = props
super(props)
this.state = {
@@ -66,13 +68,20 @@ class BackupPhraseScreen extends Component {
}
}
+ componentWillMount () {
+ const { seedWords, history } = this.props
+ if (!seedWords) {
+ history.push(DEFAULT_ROUTE)
+ }
+ }
+
renderSecretWordsContainer () {
const { isShowingSecret } = this.state
return (
{this.props.seedWords}
@@ -88,10 +97,10 @@ class BackupPhraseScreen extends Component {
)}
- );
+ )
}
- renderSecretScreen() {
+ renderSecretScreen () {
const { isShowingSecret } = this.state
return (
@@ -109,7 +118,7 @@ class BackupPhraseScreen extends Component {
className="first-time-flow__button"
onClick={() => isShowingSecret && this.setState({
isShowingSecret: false,
- page: BackupPhraseScreen.PAGE.CONFIRM
+ page: BackupPhraseScreen.PAGE.CONFIRM,
})}
disabled={!isShowingSecret}
>
@@ -133,9 +142,9 @@ class BackupPhraseScreen extends Component {
)
}
- renderConfirmationScreen() {
- const { seedWords, confirmSeedWords, next } = this.props;
- const { selectedSeeds, shuffledSeeds } = this.state;
+ renderConfirmationScreen () {
+ const { seedWords, confirmSeedWords, history } = this.props
+ const { selectedSeeds, shuffledSeeds } = this.state
const isValid = seedWords === selectedSeeds.map(([_, seed]) => seed).join(' ')
return (
@@ -165,17 +174,17 @@ class BackupPhraseScreen extends Component {