aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-04-05 03:13:30 +0800
committerDan Finlay <dan@danfinlay.com>2016-04-05 03:13:30 +0800
commitb134bb4374acf7e37f487e304ecffa08cd6d2185 (patch)
treeb3276d9dcaf77d429d4bf38573f0a71535ac1664 /app/scripts/lib
parentd8a17a25d302cfeb745c7b82eb9d329695b731f9 (diff)
downloadtangerine-wallet-browser-b134bb4374acf7e37f487e304ecffa08cd6d2185.tar
tangerine-wallet-browser-b134bb4374acf7e37f487e304ecffa08cd6d2185.tar.gz
tangerine-wallet-browser-b134bb4374acf7e37f487e304ecffa08cd6d2185.tar.bz2
tangerine-wallet-browser-b134bb4374acf7e37f487e304ecffa08cd6d2185.tar.lz
tangerine-wallet-browser-b134bb4374acf7e37f487e304ecffa08cd6d2185.tar.xz
tangerine-wallet-browser-b134bb4374acf7e37f487e304ecffa08cd6d2185.tar.zst
tangerine-wallet-browser-b134bb4374acf7e37f487e304ecffa08cd6d2185.zip
Support undefined address selection
If `setSelectedAddress` is called on the IdStore, the first account is automatically selected.
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/idStore.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 13acd7a82..7fb5a6885 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -98,6 +98,11 @@ IdentityStore.prototype.getSelectedAddress = function(){
}
IdentityStore.prototype.setSelectedAddress = function(address){
+ if (!address) {
+ var addresses = this._getAddresses()
+ address = addresses[0]
+ }
+
this._currentState.selectedAddress = address
this._didUpdate()
}