Skip to content

Commit

Permalink
fix(rosenet-node): fix bug in subscribe function
Browse files Browse the repository at this point in the history
  • Loading branch information
mkermani144 committed May 6, 2024
1 parent 4647575 commit c6c8a8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rosenet-node/lib/createRoseNetNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const createRoseNetNode = async ({
subscribe: async (topic: string, handler: (message: string) => void) => {
node.services.pubsub.subscribe(topic);
node.services.pubsub.addEventListener('message', (event) => {
if (event.detail.topic === 'topic') {
if (event.detail.topic === topic) {
const textDecoder = new TextDecoder();
handler(textDecoder.decode(event.detail.data));
}
Expand Down

0 comments on commit c6c8a8b

Please sign in to comment.