aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-11-15 00:04:55 +0800
committerDan <danjm.com@gmail.com>2017-12-05 10:38:23 +0800
commit7f795240706c013dc4a9ece0e9c9e33897c7fc71 (patch)
tree631ca16db8ea6d5efd2e57f4c25699e3482512ca /app
parent6561e75aa2fb03c77544da3c090ad6ea2883d29a (diff)
downloadtangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.gz
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.bz2
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.lz
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.xz
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.zst
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.zip
Add UI selection
Diffstat (limited to 'app')
-rw-r--r--app/scripts/controllers/preferences.js17
-rw-r--r--app/scripts/metamask-controller.js1
-rw-r--r--app/scripts/popup.js1
3 files changed, 19 insertions, 0 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 0aed4dbdf..0dd9eae1b 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -10,6 +10,7 @@ class PreferencesController {
currentAccountTab: 'history',
tokens: [],
useBlockie: false,
+ featureFlags: {},
}, opts.initState)
this.store = new ObservableStore(initState)
}
@@ -100,6 +101,22 @@ class PreferencesController {
getFrequentRpcList () {
return this.store.getState().frequentRpcList
}
+
+ setFeatureFlag (feature, activated) {
+ const currentFeatureFlags = this.store.getState().featureFlags
+ const updatedFeatureFlags = {
+ ...currentFeatureFlags,
+ [feature]: activated,
+ }
+
+ this.store.updateState({ featureFlags: updatedFeatureFlags })
+ console.log(`!!! updatedFeatureFlags`, updatedFeatureFlags);
+ return Promise.resolve(updatedFeatureFlags)
+ }
+
+ getFeatureFlags () {
+ return this.store.getState().featureFlags
+ }
//
// PRIVATE METHODS
//
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 4dce89e3a..8966ba393 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -341,6 +341,7 @@ module.exports = class MetamaskController extends EventEmitter {
addToken: nodeify(preferencesController.addToken, preferencesController),
removeToken: nodeify(preferencesController.removeToken, preferencesController),
setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab, preferencesController),
+ setFeatureFlag: nodeify(preferencesController.setFeatureFlag, preferencesController),
// AddressController
setAddressBook: nodeify(addressBookController.setAddressBook, addressBookController),
diff --git a/app/scripts/popup.js b/app/scripts/popup.js
index 5f17f0651..8cef06931 100644
--- a/app/scripts/popup.js
+++ b/app/scripts/popup.js
@@ -12,6 +12,7 @@ const notificationManager = new NotificationManager()
global.platform = new ExtensionPlatform()
// inject css
+console.log(`MetaMaskUiCss`, MetaMaskUiCss);
const css = MetaMaskUiCss()
injectCss(css)