aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/select-app.js
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2017-12-22 11:03:01 +0800
committerAlexander Tseung <alextsg@users.noreply.github.com>2017-12-22 11:03:01 +0800
commit4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13 (patch)
tree8bb568d9bcab093855e4dd57afbeaf9517dba869 /ui/app/select-app.js
parent4ef71f036510da50566dad35a100529186b08bc9 (diff)
downloadtangerine-wallet-browser-4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13.tar
tangerine-wallet-browser-4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13.tar.gz
tangerine-wallet-browser-4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13.tar.bz2
tangerine-wallet-browser-4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13.tar.lz
tangerine-wallet-browser-4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13.tar.xz
tangerine-wallet-browser-4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13.tar.zst
tangerine-wallet-browser-4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13.zip
[NewUI] Fixes tests and sends user to NewUI after registering. (#2788)
* Fixes tests and sends user to NewUI after registering. * Karma config? * Empty commit * Remove unneeded json state mock file.
Diffstat (limited to 'ui/app/select-app.js')
-rw-r--r--ui/app/select-app.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/app/select-app.js b/ui/app/select-app.js
index a51182f47..0b837b547 100644
--- a/ui/app/select-app.js
+++ b/ui/app/select-app.js
@@ -13,6 +13,7 @@ function mapStateToProps (state) {
autoAdd: autoAddToBetaUI(state),
isUnlocked: state.metamask.isUnlocked,
isMascara: state.metamask.isMascara,
+ firstTime: Object.keys(state.metamask.identities).length === 0,
}
}
@@ -35,9 +36,10 @@ SelectedApp.prototype.componentWillReceiveProps = function (nextProps) {
setFeatureFlagWithModal,
setFeatureFlagWithoutModal,
isMascara,
+ firstTime,
} = this.props
- if (isMascara) {
+ if (isMascara || firstTime) {
setFeatureFlagWithoutModal()
} else if (!isUnlocked && nextProps.isUnlocked && (nextProps.autoAdd)) {
setFeatureFlagWithModal()
@@ -45,7 +47,8 @@ SelectedApp.prototype.componentWillReceiveProps = function (nextProps) {
}
SelectedApp.prototype.render = function () {
- const { betaUI, isMascara } = this.props
- const Selected = betaUI || isMascara ? App : OldApp
+ const { betaUI, isMascara, firstTime } = this.props
+
+ const Selected = betaUI || isMascara || firstTime ? App : OldApp
return h(Selected)
}