diff options
Merge pull request #89 from MetaMask/SupportUndefinedAddressSelection
Support undefined address selection
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r-- | app/scripts/lib/idStore.js | 5 |
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() } |