aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-09-24 23:57:37 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-11-21 01:34:17 +0800
commitc482c9926c4514e67105c61f4909ff019caeb7f0 (patch)
tree4c7f66329ea888a5134c02c4b5c2e72e7f75e9f7 /app/scripts
parenta7b3750a3efd4dd521baf2aae4dab4c630aba418 (diff)
downloadtangerine-wallet-browser-c482c9926c4514e67105c61f4909ff019caeb7f0.tar.gz
tangerine-wallet-browser-c482c9926c4514e67105c61f4909ff019caeb7f0.tar.zst
tangerine-wallet-browser-c482c9926c4514e67105c61f4909ff019caeb7f0.zip
Default to the new UI for first time users
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/controllers/preferences.js4
-rw-r--r--app/scripts/ui.js17
2 files changed, 7 insertions, 14 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index ffb593b09..a5931ddc9 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -32,7 +32,9 @@ class PreferencesController {
tokens: [],
suggestedTokens: {},
useBlockie: false,
- featureFlags: {},
+ featureFlags: {
+ betaUI: true,
+ },
currentLocale: opts.initLangCode,
identities: {},
lostIdentities: {},
diff --git a/app/scripts/ui.js b/app/scripts/ui.js
index 444097f14..682a4aaac 100644
--- a/app/scripts/ui.js
+++ b/app/scripts/ui.js
@@ -1,6 +1,7 @@
const injectCss = require('inject-css')
const OldMetaMaskUiCss = require('../../old-ui/css')
const NewMetaMaskUiCss = require('../../ui/css')
+const {getShouldUseNewUi} = require('../../ui/app/selectors')
const startPopup = require('./popup-core')
const PortStream = require('extension-port-stream')
const { getEnvironmentType } = require('./lib/util')
@@ -33,10 +34,6 @@ async function start () {
return state
}
- // inject css
- // const css = MetaMaskUiCss()
- // injectCss(css)
-
// identify window type (popup, notification)
const windowType = getEnvironmentType(window.location.href)
global.METAMASK_UI_TYPE = windowType
@@ -51,15 +48,9 @@ async function start () {
startPopup({ container, connectionStream }, (err, store) => {
if (err) return displayCriticalError(err)
- // Code commented out until we begin auto adding users to NewUI
- // const { isMascara, identities = {}, featureFlags = {} } = store.getState().metamask
- // const firstTime = Object.keys(identities).length === 0
- const { isMascara, featureFlags = {} } = store.getState().metamask
- let betaUIState = featureFlags.betaUI
-
- // Code commented out until we begin auto adding users to NewUI
- // const useBetaCss = isMascara || firstTime || betaUIState
- const useBetaCss = isMascara || betaUIState
+ const state = store.getState()
+ let betaUIState = Boolean(state.featureFlags && state.featureFlags.betaUI)
+ const useBetaCss = getShouldUseNewUi(state)
let css = useBetaCss ? NewMetaMaskUiCss() : OldMetaMaskUiCss()
let deleteInjectedCss = injectCss(css)