diff --git a/demo/app/index.html b/demo/app/index.html index af92acbb2..417f60960 100644 --- a/demo/app/index.html +++ b/demo/app/index.html @@ -75,6 +75,7 @@
+ The node you are using does not support whisper

Listen To channel

diff --git a/demo/app/js/index.js b/demo/app/js/index.js index aa40e01fa..e5a1ebe6b 100644 --- a/demo/app/js/index.js +++ b/demo/app/js/index.js @@ -71,7 +71,15 @@ $(document).ready(function() { // Communication (Whisper) example // =========================== $(document).ready(function() { - EmbarkJS.Messages.setProvider('whisper'); + + $("#communication .error").hide(); + web3.version.getWhisper(function(err, res) { + if (err) { + $("#communication .error").show(); + } else { + EmbarkJS.Messages.setProvider('whisper'); + } + }); $("#communication button.listenToChannel").click(function() { var channel = $("#communication .listen input.channel").val();