aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/idStore.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-09-12 23:50:42 +0800
committerDan Finlay <dan@danfinlay.com>2016-09-12 23:50:42 +0800
commit5c1d8e299e68be6a74935f4eff56f68a9ccf5b72 (patch)
tree566dbe5d28526c73e754322b45e5394ab48fb8f6 /app/scripts/lib/idStore.js
parentf51a13abaf8808968db279c060ec360c174253c7 (diff)
downloadtangerine-wallet-browser-5c1d8e299e68be6a74935f4eff56f68a9ccf5b72.tar
tangerine-wallet-browser-5c1d8e299e68be6a74935f4eff56f68a9ccf5b72.tar.gz
tangerine-wallet-browser-5c1d8e299e68be6a74935f4eff56f68a9ccf5b72.tar.bz2
tangerine-wallet-browser-5c1d8e299e68be6a74935f4eff56f68a9ccf5b72.tar.lz
tangerine-wallet-browser-5c1d8e299e68be6a74935f4eff56f68a9ccf5b72.tar.xz
tangerine-wallet-browser-5c1d8e299e68be6a74935f4eff56f68a9ccf5b72.tar.zst
tangerine-wallet-browser-5c1d8e299e68be6a74935f4eff56f68a9ccf5b72.zip
Select first address when restoring vault
Fixes #642
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r--app/scripts/lib/idStore.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 337bf7254..8b7e3ad3b 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -59,6 +59,7 @@ IdentityStore.prototype.createNewVault = function (password, entropy, cb) {
this.configManager.setShowSeedWords(true)
var seedWords = this._idmgmt.getSeed()
+
cb(null, seedWords)
})
}
@@ -124,7 +125,7 @@ IdentityStore.prototype.getSelectedAddress = function () {
return configManager.getSelectedAccount()
}
-IdentityStore.prototype.setSelectedAddress = function (address, cb) {
+IdentityStore.prototype.setSelectedAddressSync = function (address) {
const configManager = this.configManager
if (!address) {
var addresses = this._getAddresses()
@@ -132,7 +133,12 @@ IdentityStore.prototype.setSelectedAddress = function (address, cb) {
}
configManager.setSelectedAccount(address)
- if (cb) return cb(null, address)
+ return address
+}
+
+IdentityStore.prototype.setSelectedAddress = function (address, cb) {
+ const resultAddress = this.setSelectedAddressSync(address)
+ if (cb) return cb(null, resultAddress)
}
IdentityStore.prototype.revealAccount = function (cb) {
@@ -477,6 +483,8 @@ IdentityStore.prototype._createIdmgmt = function (password, seedPhrase, entropy,
configManager: this.configManager,
})
+ this.setSelectedAddressSync()
+
cb()
})
})