diff --git a/dapps/templates/demo/app/dapp.js b/dapps/templates/demo/app/dapp.js index 999e40550..9dc060795 100644 --- a/dapps/templates/demo/app/dapp.js +++ b/dapps/templates/demo/app/dapp.js @@ -35,11 +35,8 @@ class App extends React.Component { return this.setState({error: err.message || err}); } - EmbarkJS.Messages.Providers.whisper.getWhisperVersion((err, _version) => { - if (err) { - return console.log(err); - } - this.setState({whisperEnabled: true}); + EmbarkJS.Messages.isAvailable().then(result => { + this.setState({whisperEnabled: result}); }); EmbarkJS.Storage.isAvailable().then((result) => { diff --git a/packages/embarkjs/src/messages.js b/packages/embarkjs/src/messages.js index dc69f99e5..d78dd66a3 100644 --- a/packages/embarkjs/src/messages.js +++ b/packages/embarkjs/src/messages.js @@ -21,7 +21,7 @@ Messages.setProvider = function (providerName, options) { Messages.isAvailable = function () { if (!this.currentMessages) { - return false; + return Promise.resolve(false); } return this.currentMessages.isAvailable(); };