Skip to content

Commit

Permalink
Fix error when listening to spotlight and capabilities events for cal…
Browse files Browse the repository at this point in the history
…l with chat adapter (#5066)

* Fix event subscriptions to capabilitiesChanged and spotlightChanged events for AzureCommunicationCallWithChatAdapter

* Change files

* Update changelog comment

* fix wrong unsubscription
  • Loading branch information
mgamis-msft authored Aug 24, 2024
1 parent 9a4358a commit a58c2bf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "CallWithChatAdapter events",
"comment": "Fix error when listening to capabilitiesChanged and spotlightChanged events from AzureCommunicationCallWithChatAdapter",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "CallWithChatAdapter events",
"comment": "Fix error when listening to capabilitiesChanged and spotlightChanged events from AzureCommunicationCallWithChatAdapter",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,12 @@ export class AzureCommunicationCallWithChatAdapter implements CallWithChatAdapte
case 'chatInitialized':
this.emitter.on(event, listener);
break;
case 'capabilitiesChanged':
this.callAdapter.on('capabilitiesChanged', listener);
break;
case 'spotlightChanged':
this.callAdapter.on('spotlightChanged', listener);
break;
default:
throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;
}
Expand Down Expand Up @@ -943,6 +949,12 @@ export class AzureCommunicationCallWithChatAdapter implements CallWithChatAdapte
case 'chatInitialized':
this.emitter.off(event, listener);
break;
case 'capabilitiesChanged':
this.callAdapter.off('capabilitiesChanged', listener);
break;
case 'spotlightChanged':
this.callAdapter.off('spotlightChanged', listener);
break;
default:
throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;
}
Expand Down

0 comments on commit a58c2bf

Please sign in to comment.