Skip to content

Commit 2cd5e81

Browse files
authored
Fix createAzureCommunicationCallWithChatAdapterFromClients for breakout rooms (#5683)
* Ensure createChatAdapterCallback is set in createAzureCommunicationCallWithChatAdapterFromClients so that a new ChatAdapter can be created when joining a breakout room * Change files * remove unnecessary CC
1 parent 1a36ba3 commit 2cd5e81

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Breakout rooms",
5+
"comment": "Ensure createChatAdapterCallback is set for AzureCommunicationCallWithChatAdapter in createAzureCommunicationCallWithChatAdapterFromClients so that a new ChatAdapter can be created when joining a breakout room",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Breakout rooms",
5+
"comment": "Ensure createChatAdapterCallback is set for AzureCommunicationCallWithChatAdapter in createAzureCommunicationCallWithChatAdapterFromClients so that a new ChatAdapter can be created when joining a breakout room",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}

packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,12 @@ export const createAzureCommunicationCallWithChatAdapterFromClients = async ({
14711471
callAdapterOptions
14721472
);
14731473
const chatAdapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);
1474-
return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);
1474+
const callWithChatAdapter = new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);
1475+
/* @conditional-compile-remove(breakout-rooms) */
1476+
callWithChatAdapter.setCreateChatAdapterCallback((threadId: string) =>
1477+
createAzureCommunicationChatAdapterFromClient(chatClient, chatClient.getChatThreadClient(threadId))
1478+
);
1479+
return callWithChatAdapter;
14751480
};
14761481

14771482
/**

0 commit comments

Comments
 (0)