From c6c8a8bdb8d063d81f85567e5ff5cdd0c8148c99 Mon Sep 17 00:00:00 2001 From: Mohammad Kermani Date: Mon, 6 May 2024 14:49:31 +0000 Subject: [PATCH] fix(rosenet-node): fix bug in `subscribe` function --- packages/rosenet-node/lib/createRoseNetNode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rosenet-node/lib/createRoseNetNode.ts b/packages/rosenet-node/lib/createRoseNetNode.ts index b953939..005aaeb 100644 --- a/packages/rosenet-node/lib/createRoseNetNode.ts +++ b/packages/rosenet-node/lib/createRoseNetNode.ts @@ -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)); }