use topic param for listenTo

This commit is contained in:
Jonathan Rainville 2018-08-07 09:55:14 -04:00 committed by Pascal Precht
parent 11bf667ad4
commit d3f897e204
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 4 additions and 5 deletions

View File

@ -74,7 +74,7 @@ class CommunicationContainer extends Component {
<div id="subscribeList">
{this.state.subscribedChannels.map((item, i) => <p key={i}>{item}</p>)}
</div>
{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) &&
<React.Fragment>
<p>Messages received:</p>
<div id="messagesList">

View File

@ -164,11 +164,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,