Skip to content

Commit ff473b3

Browse files
Add callOptions to make sure device info is setup for the call
1 parent 2304fa6 commit ff473b3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Project/src/MakeCall/MakeCall.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ export default class MakeCall extends React.Component {
164164

165165
this.callAgent.on('noActiveCalls', () => {
166166
console.log('noActiveCalls event received - user no longer in a call');
167+
this.setState({activeCallDetails: undefined});
167168
});
168169

169170

@@ -998,19 +999,21 @@ this.callAgent.on('incomingCall', async (args) => {
998999
</MessageBar>
9991000
}
10001001
{
1001-
this.state.activeCallDetails && <MessageBar
1002+
this.state.activeCallDetails && !this.state.call && <MessageBar
10021003
messageBarType={MessageBarType.info}
10031004
isMultiline={true}
10041005
onDismiss={() => { this.setState({ activeCallDetails: undefined }) }}
10051006
dismissButtonAriaLabel="Close">
1006-
<div className="ms-Grid-row pl-2 pr-2">
1007+
<div className="ms-Grid-row">
10071008
<b>You're in an active call!</b>
1008-
<DefaultButton onClick={async () => {
1009-
const newCall = await this.callAgent.activeCallTransfer(this.state.activeCallDetails, {isTransfer: true});
1009+
<DefaultButton className="pl-2" onClick={async () => {
1010+
const callOptions = await this.getCallOptions({video: false, micMuted: false});
1011+
const newCall = await this.callAgent.activeCallTransfer(this.state.activeCallDetails, {isTransfer: true, joinCallOptions: callOptions});
10101012
this.setState({call: newCall});
10111013
}}>Transfer to this device</DefaultButton>
1012-
<DefaultButton onClick={async () => {
1013-
const newCall = await this.callAgent.activeCallTransfer(this.state.activeCallDetails, {isTransfer: false});
1014+
<DefaultButton className="pl-2" onClick={async () => {
1015+
const callOptions = await this.getCallOptions({video: false, micMuted: false});
1016+
const newCall = await this.callAgent.activeCallTransfer(this.state.activeCallDetails, {isTransfer: false, joinCallOptions: callOptions});
10141017
this.setState({call: newCall});
10151018
}}>Join here</DefaultButton>
10161019
</div>

0 commit comments

Comments
 (0)