From 0fb569f02f9c442f5b6158b24566b86853218217 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 7 Aug 2018 09:55:14 -0400 Subject: [PATCH] use topic param for listenTo --- embark-ui/src/containers/CommunicationContainer.js | 2 +- lib/modules/whisper/index.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/embark-ui/src/containers/CommunicationContainer.js b/embark-ui/src/containers/CommunicationContainer.js index 6efc1b48..53e131c2 100644 --- a/embark-ui/src/containers/CommunicationContainer.js +++ b/embark-ui/src/containers/CommunicationContainer.js @@ -74,7 +74,7 @@ class CommunicationContainer extends Component {
{this.state.subscribedChannels.map((item, i) =>

{item}

)}
- {this.props.messages && this.props.messages.channels && this.props.messages.channels.length && + {this.props.messages && this.props.messages.channels && Boolean(Object.keys(this.props.messages.channels).length) &&

Messages received:

diff --git a/lib/modules/whisper/index.js b/lib/modules/whisper/index.js index 018b3b3e..e5bdcc21 100644 --- a/lib/modules/whisper/index.js +++ b/lib/modules/whisper/index.js @@ -145,11 +145,10 @@ class Whisper { self.embark.registerAPICall( 'ws', // FIXME channel name - '/embark-api/communication/listenTo/jorain', - (ws, _req) => { - console.log('Listen to', 'jorain'); + '/embark-api/communication/listenTo/:topic', + (ws, req) => { listenTo({ - topic: 'jorain', + topic: req.params.topic, messageEvents, toHex: self.web3.utils.toHex, toAscii: self.web3.utils.hexToAscii,