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)); }