Fix ens enabled

This commit is contained in:
Anthony Laibe 2018-08-29 10:22:43 +01:00
parent b9944b18d2
commit deb433c0fb
4 changed files with 8 additions and 9 deletions

View File

@ -20,6 +20,7 @@ class RunCode {
if (varName === 'web3') {
global.web3 = code;
}
this.context["global"][varName] = code;
this.context[varName] = code;
}

View File

@ -379,6 +379,7 @@ class CodeGenerator {
},
function getImports(web3Location, next) {
web3Location = web3Location.replace(/\\/g, '/'); // Import paths must always have forward slashes
code += "\nimport Web3 from '" + web3Location + "';\n";
code += "\nglobal.Web3 = Web3;\n";
code += "\n if (typeof web3 === 'undefined') {";
@ -389,6 +390,7 @@ class CodeGenerator {
let providerCode = self.generateProvider(false);
code += providerCode;
code += "\nglobal.__embarkContext = __mainContext.__loadManagerInstance;\n";
code += "\nexport default web3;\n";
next(null, code);
}
], cb);

View File

@ -146,7 +146,7 @@ class ENS extends React.Component {
</FormGroup>
</Form>
<h3>Register subdomain for embark</h3>
<h3>Register subdomain for eth</h3>
<Form inline onKeyDown={(e) => this.checkEnter(e, this.registerSubDomain)}>
<FormGroup>
{this.state.responseRegister &&

View File

@ -21,8 +21,7 @@ class App extends React.Component {
error: null,
activeKey: 1,
whisperEnabled: false,
storageEnabled: false,
ensEnabled: false
storageEnabled: false
};
}
@ -56,10 +55,6 @@ class App extends React.Component {
}).catch(() => {
this.setState({storageEnabled: false});
});
this.setState({
ensEnabled: EmbarkJS.Names.isAvailable()
});
});
}
@ -76,6 +71,7 @@ class App extends React.Component {
}
render() {
const ensEnabled = EmbarkJS.Names.currentNameSystems && EmbarkJS.Names.isAvailable();
if (this.state.error) {
return (<div>
<div>Something went wrong connecting to ethereum. Please make sure you have a node running or are using metamask to connect to the ethereum network:</div>
@ -94,8 +90,8 @@ class App extends React.Component {
<Tab eventKey={3} title={this._renderStatus('P2P communication (Whisper)', this.state.whisperEnabled)}>
<Whisper enabled={this.state.whisperEnabled}/>
</Tab>
<Tab eventKey={4} title={this._renderStatus('Naming (ENS)', this.state.ensEnabled)}>
<ENS enabled={this.state.ensEnabled}/>
<Tab eventKey={4} title={this._renderStatus('Naming (ENS)', ensEnabled)}>
<ENS enabled={ensEnabled}/>
</Tab>
</Tabs>
</div>);