diff options
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r-- | app/scripts/controllers/preferences.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index bc4848421..0aed4dbdf 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -9,11 +9,20 @@ class PreferencesController { frequentRpcList: [], currentAccountTab: 'history', tokens: [], + useBlockie: false, }, opts.initState) this.store = new ObservableStore(initState) } // PUBLIC METHODS + setUseBlockie (val) { + this.store.updateState({ useBlockie: val }) + } + + getUseBlockie () { + return this.store.getState().useBlockie + } + setSelectedAddress (_address) { return new Promise((resolve, reject) => { const address = normalizeAddress(_address) @@ -42,7 +51,16 @@ class PreferencesController { } this.store.updateState({ tokens }) - return Promise.resolve() + return Promise.resolve(tokens) + } + + removeToken (rawAddress) { + const tokens = this.store.getState().tokens + + const updatedTokens = tokens.filter(token => token.address !== rawAddress) + + this.store.updateState({ tokens: updatedTokens }) + return Promise.resolve(updatedTokens) } getTokens () { |