mirror of https://github.com/embarklabs/embark.git
display error in case whisper is not available
This commit is contained in:
parent
27b2f33adc
commit
878b5aa2da
|
@ -75,6 +75,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="communication">
|
<div role="tabpanel" class="tab-pane" id="communication">
|
||||||
|
<span class="error">The node you are using does not support whisper</span>
|
||||||
|
|
||||||
<h3>Listen To channel</h3>
|
<h3>Listen To channel</h3>
|
||||||
<div class="form-group form-inline listen">
|
<div class="form-group form-inline listen">
|
||||||
|
|
|
@ -71,7 +71,15 @@ $(document).ready(function() {
|
||||||
// Communication (Whisper) example
|
// Communication (Whisper) example
|
||||||
// ===========================
|
// ===========================
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
$("#communication .error").hide();
|
||||||
|
web3.version.getWhisper(function(err, res) {
|
||||||
|
if (err) {
|
||||||
|
$("#communication .error").show();
|
||||||
|
} else {
|
||||||
EmbarkJS.Messages.setProvider('whisper');
|
EmbarkJS.Messages.setProvider('whisper');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$("#communication button.listenToChannel").click(function() {
|
$("#communication button.listenToChannel").click(function() {
|
||||||
var channel = $("#communication .listen input.channel").val();
|
var channel = $("#communication .listen input.channel").val();
|
||||||
|
|
Loading…
Reference in New Issue