aboutsummaryrefslogtreecommitdiffstats
path: root/mascara/src
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-04-22 13:23:45 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-04-22 13:23:45 +0800
commit477b74124d24c9497fafb0c976eba27712c69d79 (patch)
tree8d4911513d5059b6df0f725e8e5030b37837facb /mascara/src
parent4544d57f2632ce5a00dc8780a7b360ab9b2657c3 (diff)
downloadtangerine-wallet-browser-477b74124d24c9497fafb0c976eba27712c69d79.tar
tangerine-wallet-browser-477b74124d24c9497fafb0c976eba27712c69d79.tar.gz
tangerine-wallet-browser-477b74124d24c9497fafb0c976eba27712c69d79.tar.bz2
tangerine-wallet-browser-477b74124d24c9497fafb0c976eba27712c69d79.tar.lz
tangerine-wallet-browser-477b74124d24c9497fafb0c976eba27712c69d79.tar.xz
tangerine-wallet-browser-477b74124d24c9497fafb0c976eba27712c69d79.tar.zst
tangerine-wallet-browser-477b74124d24c9497fafb0c976eba27712c69d79.zip
Revert "Fix UI getting stuck in Reveal Seed screen"
This reverts commit 2c8156ebe91941309d49e8f8f1ed8e9d740bb9de.
Diffstat (limited to 'mascara/src')
-rw-r--r--mascara/src/app/first-time/confirm-seed-screen.js14
-rw-r--r--mascara/src/app/first-time/seed-screen.js71
2 files changed, 19 insertions, 66 deletions
diff --git a/mascara/src/app/first-time/confirm-seed-screen.js b/mascara/src/app/first-time/confirm-seed-screen.js
index 7c0431431..438f383b1 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, INITIALIZE_BACKUP_PHRASE_ROUTE } from '../../../../ui/app/routes'
+import { DEFAULT_ROUTE } from '../../../../ui/app/routes'
class ConfirmSeedScreen extends Component {
static propTypes = {
@@ -53,7 +53,7 @@ class ConfirmSeedScreen extends Component {
}
render () {
- const { seedWords, history } = this.props
+ const { seedWords } = this.props
const { selectedSeeds, shuffledSeeds } = this.state
const isValid = seedWords === selectedSeeds.map(([_, seed]) => seed).join(' ')
@@ -66,16 +66,6 @@ class ConfirmSeedScreen extends Component {
<div className="first-view-main-wrapper">
<div className="first-view-main">
<div className="backup-phrase">
- <a
- className="backup-phrase__back-button"
- onClick={e => {
- e.preventDefault()
- history.push(INITIALIZE_BACKUP_PHRASE_ROUTE)
- }}
- href="#"
- >
- {`< Back`}
- </a>
<Identicon address={this.props.address} diameter={70} />
<div className="backup-phrase__content-wrapper">
<div>
diff --git a/mascara/src/app/first-time/seed-screen.js b/mascara/src/app/first-time/seed-screen.js
index 9af9ca3be..d004be77b 100644
--- a/mascara/src/app/first-time/seed-screen.js
+++ b/mascara/src/app/first-time/seed-screen.js
@@ -8,7 +8,6 @@ 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 => (
<svg
@@ -45,8 +44,6 @@ class BackupPhraseScreen extends Component {
address: PropTypes.string.isRequired,
seedWords: PropTypes.string,
history: PropTypes.object,
- isRevealingSeedWords: PropTypes.bool,
- clearSeedWords: PropTypes.func,
};
static defaultProps = {
@@ -61,14 +58,6 @@ class BackupPhraseScreen extends Component {
}
componentWillMount () {
- this.checkSeedWords()
- }
-
- componentDidUpdate () {
- this.checkSeedWords()
- }
-
- checkSeedWords () {
const { seedWords, history } = this.props
if (!seedWords) {
@@ -103,29 +92,9 @@ class BackupPhraseScreen extends Component {
)
}
- renderSubmitButton () {
- const { isRevealingSeedWords, clearSeedWords, history } = this.props
- const { isShowingSecret } = this.state
-
- return isRevealingSeedWords
- ? <button
- className="first-time-flow__button"
- onClick={() => clearSeedWords().then(() => history.push(DEFAULT_ROUTE))}
- disabled={!isShowingSecret}
- >
- Done
- </button>
- : <button
- className="first-time-flow__button"
- onClick={() => isShowingSecret && history.push(INITIALIZE_CONFIRM_SEED_ROUTE)}
- disabled={!isShowingSecret}
- >
- Next
- </button>
- }
-
renderSecretScreen () {
- const { isRevealingSeedWords } = this.props
+ const { isShowingSecret } = this.state
+ const { history } = this.props
return (
<div className="backup-phrase__content-wrapper">
@@ -152,8 +121,14 @@ class BackupPhraseScreen extends Component {
</div>
</div>
<div className="backup-phrase__next-button">
- { this.renderSubmitButton() }
- { !isRevealingSeedWords && <Breadcrumbs total={3} currentIndex={1} />}
+ <button
+ className="first-time-flow__button"
+ onClick={() => isShowingSecret && history.push(INITIALIZE_CONFIRM_SEED_ROUTE)}
+ disabled={!isShowingSecret}
+ >
+ Next
+ </button>
+ <Breadcrumbs total={3} currentIndex={1} />
</div>
</div>
)
@@ -175,25 +150,13 @@ 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(mapStateToProps, mapDispatchToProps),
+ connect(
+ ({ metamask: { selectedAddress, seedWords }, appState: { isLoading } }) => ({
+ seedWords,
+ isLoading,
+ address: selectedAddress,
+ })
+ )
)(BackupPhraseScreen)