From daee882b7b52bf751d3a649cdbc357e7b39f038f Mon Sep 17 00:00:00 2001 From: juberti Date: Thu, 28 Dec 2023 18:04:19 -0800 Subject: [PATCH] Port bugfix from SDK --- packages/voice/src/app/agent/chat.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/voice/src/app/agent/chat.tsx b/packages/voice/src/app/agent/chat.tsx index 500a3dbd..0b43dd47 100644 --- a/packages/voice/src/app/agent/chat.tsx +++ b/packages/voice/src/app/agent/chat.tsx @@ -659,11 +659,11 @@ export class WebRtcChatManager implements ChatManager { switch (msg.type) { case 'room_info': this.room = new Room(); + this.room.on(RoomEvent.TrackSubscribed, (track) => this.handleTrackSubscribed(track)); + this.room.on(RoomEvent.DataReceived, (payload, participant) => this.handleDataReceived(payload, participant)); await this.room.connect(msg.roomUrl, msg.token); console.log('[chat] connected to room', this.room.name); this.maybePublishLocalAudio(); - this.room.on(RoomEvent.TrackSubscribed, (track) => this.handleTrackSubscribed(track)); - this.room.on(RoomEvent.DataReceived, (payload, participant) => this.handleDataReceived(payload, participant)); break; default: console.warn('unknown message type', msg.type);