aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/keyring-controller.js
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-01-31 07:57:49 +0800
committerGitHub <noreply@github.com>2017-01-31 07:57:49 +0800
commit82578538198de74955d7bc5cfd3c9a02d1b69a6d (patch)
treeaad1a62ee4ed4b7e34c0bd78b9f680dc2aeaaded /app/scripts/keyring-controller.js
parentb6909574a7036c396ed85809cbd90aa2171b012f (diff)
parent0b9d37c6c8e714eb26bec5156e984a6b0cd268ad (diff)
downloadtangerine-wallet-browser-82578538198de74955d7bc5cfd3c9a02d1b69a6d.tar.gz
tangerine-wallet-browser-82578538198de74955d7bc5cfd3c9a02d1b69a6d.tar.zst
tangerine-wallet-browser-82578538198de74955d7bc5cfd3c9a02d1b69a6d.zip
Merge pull request #1069 from MetaMask/i1066
Introduce Preferences Controller
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r--app/scripts/keyring-controller.js28
1 files changed, 1 insertions, 27 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 40cc975f9..f7a4e4010 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -88,8 +88,6 @@ class KeyringController extends EventEmitter {
keyringTypes: this.keyringTypes.map(krt => krt.type),
// memStore
identities: this.identities,
- // diskStore
- selectedAccount: state.selectedAccount,
// configManager
seedWords: this.configManager.getSeedWords(),
isDisclaimerConfirmed: this.configManager.getConfirmedDisclaimer(),
@@ -152,7 +150,7 @@ class KeyringController extends EventEmitter {
const firstAccount = accounts[0]
if (!firstAccount) throw new Error('KeyringController - First Account not found.')
const hexAccount = normalizeAddress(firstAccount)
- this.setSelectedAccount(hexAccount)
+ this.emit('newAccount', hexAccount)
return this.setupAccounts(accounts)
})
.then(this.persistAllKeyrings.bind(this, password))
@@ -231,28 +229,6 @@ class KeyringController extends EventEmitter {
.then(this.fullUpdate.bind(this))
}
- // Set Selected Account
- // @string address
- //
- // returns Promise( @string address )
- //
- // Sets the state's `selectedAccount` value
- // to the specified address.
- setSelectedAccount (account) {
- var address = normalizeAddress(account)
- this.store.updateState({ selectedAccount: address })
- return this.fullUpdate()
- }
-
- // Get Selected Account
- //
- // returns String
- //
- // Gets the state's `selectedAccount` value
- getSelectedAccount () {
- return this.store.getState().selectedAccount
- }
-
// Save Account Label
// @string account
// @string label
@@ -415,7 +391,6 @@ class KeyringController extends EventEmitter {
const firstAccount = accounts[0]
if (!firstAccount) throw new Error('KeyringController - No account found on keychain.')
const hexAccount = normalizeAddress(firstAccount)
- this.setSelectedAccount(hexAccount)
this.emit('newAccount', hexAccount)
return this.setupAccounts(accounts)
})
@@ -662,7 +637,6 @@ class KeyringController extends EventEmitter {
this.keyrings = []
this.identities = {}
- this.setSelectedAccount()
}
}