Removed timeout

This commit is contained in:
Richard Ramos 2018-04-27 11:47:35 -04:00
parent c8effb7dcb
commit dbb640642b
1 changed files with 8 additions and 10 deletions

View File

@ -21,30 +21,28 @@ class App extends React.Component {
} }
componentDidMount(){ componentDidMount(){
let _this = this; __embarkContext.execWhenReady(() => {
setTimeout(() => {
if (EmbarkJS.isNewWeb3()) { if (EmbarkJS.isNewWeb3()) {
EmbarkJS.Messages.Providers.whisper.getWhisperVersion(function(err, version){ EmbarkJS.Messages.Providers.whisper.getWhisperVersion((err, version) => {
if(!err) if(!err)
_this.setState({whisperEnabled: true}) this.setState({whisperEnabled: true})
else else
console.log(err); console.log(err);
}); });
} else { } else {
if (EmbarkJS.Messages.providerName === 'whisper') { if (EmbarkJS.Messages.providerName === 'whisper') {
EmbarkJS.Messages.getWhisperVersion(function(err, version) { EmbarkJS.Messages.getWhisperVersion((err, version) => {
if(!err) if(!err)
_this.setState({whisperEnabled: true}) this.setState({whisperEnabled: true})
else else
console.log(err); console.log(err);
}); });
} }
} }
}, 500);
this.setState({ this.setState({
storageEnabled: true storageEnabled: true
});
}); });
} }