diff options
Add UI selection
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/controllers/preferences.js | 17 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 1 | ||||
-rw-r--r-- | app/scripts/popup.js | 1 |
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) |