diff --git a/pusher/src/Model/PusherRoom.ts b/pusher/src/Model/PusherRoom.ts index 27e33451..62b30387 100644 --- a/pusher/src/Model/PusherRoom.ts +++ b/pusher/src/Model/PusherRoom.ts @@ -104,11 +104,11 @@ export class PusherRoom { // Let's dispatch this variable to all the listeners for (const listener of this.listeners) { - const subMessage = new SubMessage(); if (!readableBy || listener.tags.includes(readableBy)) { + const subMessage = new SubMessage(); subMessage.setVariablemessage(variableMessage); + listener.emitInBatch(subMessage); } - listener.emitInBatch(subMessage); } } else if (message.hasErrormessage()) { const errorMessage = message.getErrormessage() as ErrorMessage;