aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/keyring-controller.js
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-01-25 04:06:59 +0800
committerFrankie <frankie.diamond@gmail.com>2017-01-25 04:06:59 +0800
commit8642ced310890c7a3202a2826a2c74fad1fefca3 (patch)
tree5a3946e331dd5cb49a5aa88804cab072854098b6 /app/scripts/keyring-controller.js
parent85b34e3f2b89df9e8fbacc99b7bb39de977319d5 (diff)
downloadtangerine-wallet-browser-8642ced310890c7a3202a2826a2c74fad1fefca3.tar.gz
tangerine-wallet-browser-8642ced310890c7a3202a2826a2c74fad1fefca3.tar.zst
tangerine-wallet-browser-8642ced310890c7a3202a2826a2c74fad1fefca3.zip
Fix issue where generating a new account would put it in loose keys
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r--app/scripts/keyring-controller.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 86c93f5a3..95f0a1d63 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -259,9 +259,8 @@ module.exports = class KeyringController extends EventEmitter {
// Calls the `addAccounts` method on the Keyring
// in the kryings array at index `keyringNum`,
// and then saves those changes.
- addNewAccount (keyRingNum = 0) {
- const ring = this.keyrings[keyRingNum]
- return ring.addAccounts(1)
+ addNewAccount (selectedKeyring) {
+ return selectedKeyring.addAccounts(1)
.then(this.setupAccounts.bind(this))
.then(this.persistAllKeyrings.bind(this))
.then(this.fullUpdate.bind(this))
@@ -587,6 +586,10 @@ module.exports = class KeyringController extends EventEmitter {
return this.keyringTypes.find(kr => kr.type === type)
}
+ getKeyringsByType (type) {
+ return this.keyrings.filter((keyring) => keyring.type === type)
+ }
+
// Get Accounts
// returns Promise( @Array[ @string accounts ] )
//