@@ -168,7 +168,7 @@ export default class MakeCall extends React.Component {
168168 this . activeCallTransferFeature = this . callAgent . feature ( Features . ActiveCallTransfer ) ;
169169 try {
170170 this . activeCallTransferFeature . on ( 'activeCallsUpdated' , ( args ) => {
171- console . log ( `activeCallsUpdated, activeCalls=${ args . activeCallDetails } ` ) ;
171+ console . log ( `activeCallsUpdated, activeCalls=` , args . activeCallDetails ) ;
172172 this . setState ( { activeCallDetails : args . activeCallDetails } ) ;
173173 } ) ;
174174
@@ -1015,30 +1015,43 @@ this.callAgent.on('incomingCall', async (args) => {
10151015 </ MessageBar >
10161016 }
10171017 {
1018- this . state . activeCallDetails && ! this . state . call && < MessageBar
1019- messageBarType = { MessageBarType . warning }
1020- isMultiline = { true }
1021- onDismiss = { ( ) => { this . setState ( { activeCallDetails : undefined } ) } }
1022- dismissButtonAriaLabel = "Close" >
1023- < div className = "ms-Grid-row" >
1024- < b className = "ms-Grid-col" > You're in an active call!</ b >
1025- < div className = "ms-Grid-col" >
1026- < DefaultButton onClick = { async ( ) => {
1027- const callOptions = await this . getCallOptions ( { video : false , micMuted : false } ) ;
1028- const newCall = await this . activeCallTransferFeature . activeCallTransfer ( this . state . activeCallDetails , { isTransfer : true , joinCallOptions : callOptions } ) ;
1029- this . setState ( { call : newCall } ) ;
1030- } } > Transfer to this device</ DefaultButton >
1031- </ div >
1032- < div className = "ms-Grid-col" >
1033- < DefaultButton onClick = { async ( ) => {
1034- const callOptions = await this . getCallOptions ( { video : false , micMuted : false } ) ;
1035- const newCall = await this . activeCallTransferFeature . activeCallTransfer ( this . state . activeCallDetails , { isTransfer : false , joinCallOptions : callOptions } ) ;
1036- this . setState ( { call : newCall } ) ;
1037- } } > Add this device</ DefaultButton >
1038- </ div >
1039-
1040- </ div >
1041- </ MessageBar >
1018+ this . state . activeCallDetails ? < >
1019+ { this . state . activeCallDetails . map ( ( call ) => {
1020+ let callTitle ;
1021+ if ( 'organizerId' in call ) {
1022+ callTitle = `Meeting with organizerId: ${ call . organizerId } ` ;
1023+ } else {
1024+ const participantCount = call . participants . length ;
1025+ callTitle = `Call with ${ participantCount > 1 ? participantCount : call . participants [ 0 ] } participants` ;
1026+ }
1027+ return (
1028+ call && ! this . state . call && < MessageBar
1029+ messageBarType = { MessageBarType . warning }
1030+ isMultiline = { true }
1031+ onDismiss = { ( ) => { this . setState ( { activeCallDetails : this . state . activeCallDetails . filter ( c => c !== call ) } ) } }
1032+ dismissButtonAriaLabel = "Close" >
1033+ < div className = "ms-Grid-row" >
1034+ < b className = "ms-Grid-col" > You're in an active call!</ b >
1035+ < b className = "ms-Grid-col" > { callTitle } </ b >
1036+ < div className = "ms-Grid-col" >
1037+ < DefaultButton onClick = { async ( ) => {
1038+ const callOptions = await this . getCallOptions ( { video : false , micMuted : false } ) ;
1039+ const newCall = await this . activeCallTransferFeature . activeCallTransfer ( call , { isTransfer : true , joinCallOptions : callOptions } ) ;
1040+ this . setState ( { call : newCall } ) ;
1041+ } } > Transfer to this device</ DefaultButton >
1042+ </ div >
1043+ < div className = "ms-Grid-col" >
1044+ < DefaultButton onClick = { async ( ) => {
1045+ const callOptions = await this . getCallOptions ( { video : false , micMuted : false } ) ;
1046+ const newCall = await this . activeCallTransferFeature . activeCallTransfer ( call , { isTransfer : false , joinCallOptions : callOptions } ) ;
1047+ this . setState ( { call : newCall } ) ;
1048+ } } > Add this device</ DefaultButton >
1049+ </ div >
1050+ </ div >
1051+ </ MessageBar >
1052+ ) ;
1053+ } ) }
1054+ </ > : < > </ >
10421055 }
10431056 {
10441057 ! this . state . incomingCall && ! this . state . call && ! this . state . callSurvey &&
0 commit comments