On Wallet page, refresh address if it doesn't match the current wallet

This commit is contained in:
Alex Liebowitz 2016-09-02 01:46:27 -04:00
parent 96dedbf1bd
commit 8ebddc5a9f

View file

@ -18,10 +18,16 @@ var AddressSection = React.createClass({
componentWillMount: function() {
var address = localStorage.getItem('wallet_address');
if (address === null) {
self._refreshAddress();
this._refreshAddress();
} else {
this.setState({
address: address,
lbry.checkAddressIsMine(address, (isMine) => {
if (isMine) {
this.setState({
address: address,
});
} else {
this._refreshAddress();
}
});
}
},