aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/controllers/preferences.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/scripts/lib/controllers/preferences.js b/app/scripts/lib/controllers/preferences.js
index 8cc320179..7bd2e5631 100644
--- a/app/scripts/lib/controllers/preferences.js
+++ b/app/scripts/lib/controllers/preferences.js
@@ -25,6 +25,14 @@ class PreferencesController {
return this.store.getState().selectedAddress
}
+ updateFrequentRpcList (_url) {
+ return this.addToFrequentRpcList(_url)
+ .then((rpcList) => {
+ this.store.updateState({ frequentRpcList: rpcList })
+ return rpcList
+ })
+ }
+
addToFrequentRpcList (_url) {
let rpcList = this.getFrequentRpcList()
let index = rpcList.findIndex((element) => { return element === _url })
@@ -37,8 +45,7 @@ class PreferencesController {
if (rpcList.length > 2) {
rpcList.shift()
}
- this.store.updateState({ frequentRpcList: rpcList })
- return Promise.resolve()
+ return Promise.resolve(rpcList)
}
getFrequentRpcList () {
@@ -49,6 +56,8 @@ class PreferencesController {
// PRIVATE METHODS
//
+
+
}
module.exports = PreferencesController