diff options
Diffstat (limited to 'ui/app/select-app.js')
-rw-r--r-- | ui/app/select-app.js | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/ui/app/select-app.js b/ui/app/select-app.js index f2e8e8d10..f5f9e33ab 100644 --- a/ui/app/select-app.js +++ b/ui/app/select-app.js @@ -5,17 +5,14 @@ const h = require('react-hyperscript') const { HashRouter } = require('react-router-dom') const App = require('./app') const OldApp = require('../../old-ui/app/app') -const { autoAddToBetaUI } = require('./selectors') +const { getShouldUseNewUi } = require('./selectors') const { setFeatureFlag } = require('./actions') const I18nProvider = require('./i18n-provider') function mapStateToProps (state) { return { - betaUI: state.metamask.featureFlags.betaUI, - autoAdd: autoAddToBetaUI(state), - isUnlocked: state.metamask.isUnlocked, isMascara: state.metamask.isMascara, - firstTime: Object.keys(state.metamask.identities).length === 0, + shouldUseNewUi: getShouldUseNewUi(state), } } @@ -56,17 +53,13 @@ SelectedApp.prototype.componentWillReceiveProps = function (nextProps) { } SelectedApp.prototype.render = function () { - // Code commented out until we begin auto adding users to NewUI - // const { betaUI, isMascara, firstTime } = this.props - // const Selected = betaUI || isMascara || firstTime ? App : OldApp - - const { betaUI, isMascara } = this.props - - return betaUI || isMascara - ? h(HashRouter, { - hashType: 'noslash', - }, [ - h(I18nProvider, [ h(App) ]), - ]) - : h(OldApp) + const { shouldUseNewUi } = this.props + const newUi = h(HashRouter, { + hashType: 'noslash', + }, [ + h(I18nProvider, [ + h(App), + ]), + ]) + return shouldUseNewUi ? newUi : h(OldApp) } |