aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-21 03:40:44 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-21 03:40:44 +0800
commit7d5aaaa5bd8a0f34694eb3e8ce5ba6bbecf03d71 (patch)
tree9032a488654844f1aad0c4c0bfc892e2786c4aa2 /app
parentb0f92e05b12fa5cde453c7b53a19f6b0bca74f75 (diff)
downloadtangerine-wallet-browser-7d5aaaa5bd8a0f34694eb3e8ce5ba6bbecf03d71.tar
tangerine-wallet-browser-7d5aaaa5bd8a0f34694eb3e8ce5ba6bbecf03d71.tar.gz
tangerine-wallet-browser-7d5aaaa5bd8a0f34694eb3e8ce5ba6bbecf03d71.tar.bz2
tangerine-wallet-browser-7d5aaaa5bd8a0f34694eb3e8ce5ba6bbecf03d71.tar.lz
tangerine-wallet-browser-7d5aaaa5bd8a0f34694eb3e8ce5ba6bbecf03d71.tar.xz
tangerine-wallet-browser-7d5aaaa5bd8a0f34694eb3e8ce5ba6bbecf03d71.tar.zst
tangerine-wallet-browser-7d5aaaa5bd8a0f34694eb3e8ce5ba6bbecf03d71.zip
Add ability to add account to vault
Scrolling to the bottom of the accounts page now reveals a downward-facing chevron button. Pressing this button shows loading indication, adds a new account to the identity vault, displays it in the list, and scrolls the list to the bottom of the page. Any number of accounts can be generated in this way, and the UX feels intuitive without having to overly explain how HD paths work.
Diffstat (limited to 'app')
-rw-r--r--app/scripts/background.js1
-rw-r--r--app/scripts/lib/idStore.js15
2 files changed, 16 insertions, 0 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index a52eab2d3..e77df1519 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -182,6 +182,7 @@ function setupControllerConnection(stream){
setLocked: idStore.setLocked.bind(idStore),
clearSeedWordCache: idStore.clearSeedWordCache.bind(idStore),
exportAccount: idStore.exportAccount.bind(idStore),
+ revealAccount: idStore.revealAccount.bind(idStore),
})
stream.pipe(dnode).pipe(stream)
dnode.on('remote', function(remote){
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 6d3d0c0aa..0604c4bca 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -115,6 +115,21 @@ IdentityStore.prototype.setSelectedAddress = function(address, cb){
if (cb) return cb(null, address)
}
+IdentityStore.prototype.revealAccount = function(cb) {
+ let addresses = this._getAddresses()
+ const derivedKey = this._idmgmt.derivedKey
+ const keyStore = this._keyStore
+
+ keyStore.setDefaultHdDerivationPath(this.hdPathString)
+ keyStore.generateNewAddress(derivedKey, 1)
+ configManager.setWallet(keyStore.serialize())
+
+ addresses = this._getAddresses()
+ this._loadIdentities()
+ this._didUpdate()
+ cb(null)
+}
+
IdentityStore.prototype.getNetwork = function(tries) {
if (tries === 0) return
this.web3.version.getNetwork((err, network) => {