add error if no default account because of metamask

This commit is contained in:
Jonathan Rainville 2018-08-09 10:07:46 -04:00
parent ab73327b76
commit 3e07469680
1 changed files with 7 additions and 1 deletions

View File

@ -25,8 +25,13 @@ class ENS extends React.Component {
};
}
componentWillMount() {
componentDidMount() {
EmbarkJS.onReady(() => {
if (!web3.eth.defaultAccount) {
this.setState({
globalError: 'There is currently no default account. If Metamask is active, please sign in or deactivate it.'
});
}
this.setState({
addressRegister: web3.eth.defaultAccount,
valueLookup: web3.eth.defaultAccount
@ -102,6 +107,7 @@ class ENS extends React.Component {
render() {
return (<React.Fragment>
{this.state.globalError && <Alert bsStyle="danger">{this.state.globalError}</Alert>}
<h3>Resolve a name</h3>
<Form inline>
<FormGroup>