aboutsummaryrefslogtreecommitdiffstats
path: root/ui/index.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2017-12-23 03:00:46 +0800
committerAlexander Tseung <alextsg@gmail.com>2017-12-23 03:00:46 +0800
commit06410381d4b738fe22aa24973c7f9568d295f570 (patch)
tree69bd8701cdaa417cb6c0f46deff43414122101db /ui/index.js
parent06f496310ce7d719bbb5690f307db143ba57a1a7 (diff)
parenta218008adf85dfb5fa8ca93c789e14d9f2090813 (diff)
downloadtangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.gz
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.bz2
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.lz
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.xz
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.zst
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.zip
Merge branch 'NewUI-flat' into merge-master
Diffstat (limited to 'ui/index.js')
-rw-r--r--ui/index.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/index.js b/ui/index.js
index ae05cbe67..bc3676c1f 100644
--- a/ui/index.js
+++ b/ui/index.js
@@ -4,11 +4,12 @@ const Root = require('./app/root')
const actions = require('./app/actions')
const configureStore = require('./app/store')
const txHelper = require('./lib/tx-helper')
+const { OLD_UI_NETWORK_TYPE, BETA_UI_NETWORK_TYPE } = require('../app/scripts/config').enums
+
global.log = require('loglevel')
module.exports = launchMetamaskUi
-
log.setLevel(global.METAMASK_DEBUG ? 'debug' : 'warn')
function launchMetamaskUi (opts, cb) {
@@ -36,10 +37,17 @@ function startApp (metamaskState, accountManager, opts) {
networkVersion: opts.networkVersion,
})
+ const useBetaUi = metamaskState.featureFlags.betaUI
+ const networkEndpointType = useBetaUi ? BETA_UI_NETWORK_TYPE : OLD_UI_NETWORK_TYPE
+ store.dispatch(actions.setNetworkEndpoints(networkEndpointType))
+
// if unconfirmed txs, start on txConf page
const unapprovedTxsAll = txHelper(metamaskState.unapprovedTxs, metamaskState.unapprovedMsgs, metamaskState.unapprovedPersonalMsgs, metamaskState.unapprovedTypedMessages, metamaskState.network)
- if (unapprovedTxsAll.length > 0) {
- store.dispatch(actions.showConfTxPage())
+ const numberOfUnapprivedTx = unapprovedTxsAll.length
+ if (numberOfUnapprivedTx > 0) {
+ store.dispatch(actions.showConfTxPage({
+ id: unapprovedTxsAll[numberOfUnapprivedTx - 1].id,
+ }))
}
accountManager.on('update', function (metamaskState) {