mirror of https://github.com/embarklabs/embark.git
add error if no default account because of metamask
This commit is contained in:
parent
f0f9840757
commit
19f22025ad
|
@ -25,8 +25,13 @@ class ENS extends React.Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
componentDidMount() {
|
||||||
EmbarkJS.onReady(() => {
|
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({
|
this.setState({
|
||||||
addressRegister: web3.eth.defaultAccount,
|
addressRegister: web3.eth.defaultAccount,
|
||||||
valueLookup: web3.eth.defaultAccount
|
valueLookup: web3.eth.defaultAccount
|
||||||
|
@ -102,6 +107,7 @@ class ENS extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (<React.Fragment>
|
return (<React.Fragment>
|
||||||
|
{this.state.globalError && <Alert bsStyle="danger">{this.state.globalError}</Alert>}
|
||||||
<h3>Resolve a name</h3>
|
<h3>Resolve a name</h3>
|
||||||
<Form inline>
|
<Form inline>
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
|
|
Loading…
Reference in New Issue