aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-22 04:11:30 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-22 04:11:30 +0800
commit626b52d24a3db05bf4f4e05df53f886615cc9538 (patch)
tree5a3ce6d5a08205a3f939292ebd3469f613ff7965 /app
parentee73e373a0736e1dd1304cedf662e9d575d178c7 (diff)
downloadtangerine-wallet-browser-626b52d24a3db05bf4f4e05df53f886615cc9538.tar
tangerine-wallet-browser-626b52d24a3db05bf4f4e05df53f886615cc9538.tar.gz
tangerine-wallet-browser-626b52d24a3db05bf4f4e05df53f886615cc9538.tar.bz2
tangerine-wallet-browser-626b52d24a3db05bf4f4e05df53f886615cc9538.tar.lz
tangerine-wallet-browser-626b52d24a3db05bf4f4e05df53f886615cc9538.tar.xz
tangerine-wallet-browser-626b52d24a3db05bf4f4e05df53f886615cc9538.tar.zst
tangerine-wallet-browser-626b52d24a3db05bf4f4e05df53f886615cc9538.zip
Fix bug in new KeyringController vault restoring logic.
Diffstat (limited to 'app')
-rw-r--r--app/scripts/keyring-controller.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 5cf2542cc..807752a94 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -18,6 +18,8 @@ module.exports = class KeyringController extends EventEmitter {
this.configManager = opts.configManager
this.ethStore = opts.ethStore
this.encryptor = encryptor
+ this.keyringTypes = keyringTypes
+
this.keyrings = []
this.identities = {} // Essentially a name hash
}
@@ -37,7 +39,7 @@ module.exports = class KeyringController extends EventEmitter {
currentFiat: this.configManager.getCurrentFiat(),
conversionRate: this.configManager.getConversionRate(),
conversionDate: this.configManager.getConversionDate(),
- keyringTypes: keyringTypes.map((krt) => krt.type()),
+ keyringTypes: this.keyringTypes.map((krt) => krt.type()),
identities: this.identities,
}
}
@@ -154,7 +156,7 @@ module.exports = class KeyringController extends EventEmitter {
})
}
- restoreKeyring(serialized, i) {
+ restoreKeyring(i, serialized) {
const { type, data } = serialized
const Keyring = this.getKeyringClassForType(type)
const keyring = new Keyring()
@@ -168,7 +170,7 @@ module.exports = class KeyringController extends EventEmitter {
}
getKeyringClassForType(type) {
- const Keyring = keyringTypes.reduce((res, kr) => {
+ const Keyring = this.keyringTypes.reduce((res, kr) => {
if (kr.type() === type) {
return kr
} else {