From fc46a16a329df296cb565e3a0b04f268d2aeceb5 Mon Sep 17 00:00:00 2001 From: Jason Clark Date: Fri, 24 Nov 2017 10:35:17 -0700 Subject: toggle wired up to preferences property store --- app/scripts/controllers/preferences.js | 4 ++-- app/scripts/metamask-controller.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index c0454f77b..7ccb0e730 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -14,8 +14,8 @@ class PreferencesController { } // PUBLIC METHODS - toggleUseBlockie () { - this.store.updateState({ useBlockie: !this.useBlockie() }) + setUseBlockie (val) { + this.store.updateState({ useBlockie: val }) } getUseBlockie () { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index bd71da8e0..3a935d895 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -315,6 +315,7 @@ module.exports = class MetamaskController extends EventEmitter { // etc getState: (cb) => cb(null, this.getState()), setCurrentCurrency: this.setCurrentCurrency.bind(this), + setUseBlockie: this.setUseBlockie.bind(this), markAccountsFound: this.markAccountsFound.bind(this), // coinbase @@ -774,4 +775,13 @@ module.exports = class MetamaskController extends EventEmitter { return rpcTarget } + setUseBlockie(val, cb) { + try { + this.preferencesController.setUseBlockie(val) + cb(null) + } catch (err) { + cb(err) + } + } + } -- cgit v1.2.3