Support undefined address selection

If `setSelectedAddress` is called on the IdStore, the first account is automatically selected.
This commit is contained in:
Dan Finlay 2016-04-04 12:13:30 -07:00
parent d8a17a25d3
commit b134bb4374
1 changed files with 5 additions and 0 deletions

View File

@ -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()
}