diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-04-02 17:59:49 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-04-02 17:59:49 +0800 |
commit | 6277a4c46aa2fd94f0fff047aff346d7f255224d (patch) | |
tree | fa620da6b9143f85080aa18c412db7465965edec /ui/app/components/pages | |
parent | 2fa554a6414d2231dcd6f2476866ea9c1c7b80ca (diff) | |
download | tangerine-wallet-browser-6277a4c46aa2fd94f0fff047aff346d7f255224d.tar tangerine-wallet-browser-6277a4c46aa2fd94f0fff047aff346d7f255224d.tar.gz tangerine-wallet-browser-6277a4c46aa2fd94f0fff047aff346d7f255224d.tar.bz2 tangerine-wallet-browser-6277a4c46aa2fd94f0fff047aff346d7f255224d.tar.lz tangerine-wallet-browser-6277a4c46aa2fd94f0fff047aff346d7f255224d.tar.xz tangerine-wallet-browser-6277a4c46aa2fd94f0fff047aff346d7f255224d.tar.zst tangerine-wallet-browser-6277a4c46aa2fd94f0fff047aff346d7f255224d.zip |
Refactor onboarding flow
Diffstat (limited to 'ui/app/components/pages')
-rw-r--r-- | ui/app/components/pages/add-token.js | 4 | ||||
-rw-r--r-- | ui/app/components/pages/home.js | 22 | ||||
-rw-r--r-- | ui/app/components/pages/keychains/restore-vault.js | 2 | ||||
-rw-r--r-- | ui/app/components/pages/keychains/reveal-seed.js | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/ui/app/components/pages/add-token.js b/ui/app/components/pages/add-token.js index a5b5ea57b..d387720e5 100644 --- a/ui/app/components/pages/add-token.js +++ b/ui/app/components/pages/add-token.js @@ -384,7 +384,7 @@ AddTokenScreen.prototype.render = function () { return h('div.add-token', [ h('div.add-token__header', [ h('div.add-token__header__cancel', { - onClick: () => history.goBack(), + onClick: () => history.push(DEFAULT_ROUTE), }, [ h('i.fa.fa-angle-left.fa-lg'), h('span', this.context.t('cancel')), @@ -417,7 +417,7 @@ AddTokenScreen.prototype.render = function () { !isShowingConfirmation && h('div.add-token__buttons', [ h('button.btn-secondary--lg.add-token__cancel-button', { - onClick: () => history.goBack(), + onClick: () => history.push(DEFAULT_ROUTE), }, this.context.t('cancel')), h('button.btn-primary--lg.add-token__confirm-button', { onClick: this.onNext, diff --git a/ui/app/components/pages/home.js b/ui/app/components/pages/home.js index 4f8c00768..34cdb8a4d 100644 --- a/ui/app/components/pages/home.js +++ b/ui/app/components/pages/home.js @@ -35,11 +35,11 @@ class Home extends Component { unapprovedTypedMessagesCount = 0, } = this.props - console.log('IN HOME COMPONENDIMOUNT') + console.log('HOME MOUNTED') + // unapprovedTxs and unapproved messages if (Object.keys(unapprovedTxs).length || unapprovedTypedMessagesCount + unapprovedMsgCount + unapprovedPersonalMsgCount > 0) { - console.log('IN HOME SHOULD REDIRECT') this.props.history.push(CONFIRM_TRANSACTION_ROUTE) } } @@ -55,6 +55,15 @@ class Home extends Component { seedWords, } = this.props + // notices + if (!noActiveNotices || (lostAccounts && lostAccounts.length > 0)) { + return h(Redirect, { + to: { + pathname: NOTICE_ROUTE, + }, + }) + } + // seed words if (seedWords) { log.debug('rendering seed words') @@ -74,15 +83,6 @@ class Home extends Component { }) } - // notices - if (!noActiveNotices || (lostAccounts && lostAccounts.length > 0)) { - return h(Redirect, { - to: { - pathname: NOTICE_ROUTE, - }, - }) - } - // if (!props.noActiveNotices) { // log.debug('rendering notice screen for unread notices.') // return h(NoticeScreen, { diff --git a/ui/app/components/pages/keychains/restore-vault.js b/ui/app/components/pages/keychains/restore-vault.js index 24ebf89e3..77ec32efe 100644 --- a/ui/app/components/pages/keychains/restore-vault.js +++ b/ui/app/components/pages/keychains/restore-vault.js @@ -24,7 +24,7 @@ class RestoreVaultPage extends PersistentForm { cancel () { this.props.unMarkPasswordForgotten() - .then(this.props.history.goBack()) + .then(this.props.history.push(DEFAULT_ROUTE)) } createNewVaultAndRestore () { diff --git a/ui/app/components/pages/keychains/reveal-seed.js b/ui/app/components/pages/keychains/reveal-seed.js index 029eb7d8e..247f3c8e2 100644 --- a/ui/app/components/pages/keychains/reveal-seed.js +++ b/ui/app/components/pages/keychains/reveal-seed.js @@ -133,7 +133,7 @@ class RevealSeedPage extends Component { }, [ // cancel h('button.primary', { - onClick: () => history.goBack(), + onClick: () => history.push(DEFAULT_ROUTE), }, 'CANCEL'), // submit |