Skip to content

Commit

Permalink
Fix console error that requested teams conference details in unsuppor…
Browse files Browse the repository at this point in the history
…ted calls (#5444)

* Add meeting conference check

* Change files
  • Loading branch information
JamesBurnside authored Nov 27, 2024
1 parent 85c3c30 commit 2dfbec5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Fix console error that requested teams conference details in unsupported calls",
"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": "",
"comment": "Fix console error that requested teams conference details in unsupported calls",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
3 changes: 2 additions & 1 deletion packages/calling-stateful-client/src/CallSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { BreakoutRoomsSubscriber } from './BreakoutRoomsSubscriber';
import { TogetherModeSubscriber } from './TogetherModeSubscriber';
/* @conditional-compile-remove(media-access) */
import { MediaAccessSubscriber } from './MediaAccessSubscriber';
import { _isTeamsMeeting } from './TypeGuards';

/**
* Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us
Expand Down Expand Up @@ -301,7 +302,7 @@ export class CallSubscriber {
};

private initTeamsMeetingConference = (): void => {
if (this._call.state === 'Connected') {
if (this._call.state === 'Connected' && _isTeamsMeeting(this._call)) {
this._call
.feature(Features.TeamsMeetingAudioConferencing)
.getTeamsMeetingAudioConferencingDetails()
Expand Down
7 changes: 7 additions & 0 deletions packages/calling-stateful-client/src/TypeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ export const _isTeamsIncomingCall = (call: IncomingCallCommon): boolean => {
export const _isACSIncomingCall = (call: IncomingCallCommon): boolean => {
return call.kind === 'IncomingCall';
};

/**
* @internal
*/
export const _isTeamsMeeting = (call: CallCommon): boolean => {
return 'info' in call && !!call.info.threadId;
};

0 comments on commit 2dfbec5

Please sign in to comment.