File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1390,11 +1390,14 @@ export default class CallCard extends React.Component {
13901390 }
13911391
13921392 handleVideoPin = ( streamTuple , e ) => {
1393- // e.preventDefault();
13941393 const checked = e . target . checked ;
13951394 const allRemoteParticipantStreams = this . state . allRemoteParticipantStreams ;
13961395 // If there is already 2 streams pinned and the user is trying to pin another stream, return
13971396 if ( allRemoteParticipantStreams . filter ( streamTuple => streamTuple . isPinned ) . length >= 2 && checked ) {
1397+ allRemoteParticipantStreams . find ( v => v === streamTuple ) . isPinned = false ;
1398+ this . setState ( {
1399+ allRemoteParticipantStreams : allRemoteParticipantStreams ,
1400+ } ) ;
13981401 return ;
13991402 }
14001403
@@ -2110,13 +2113,14 @@ export default class CallCard extends React.Component {
21102113 </ div >
21112114 < div >
21122115 { this . state . allRemoteParticipantStreams . map ( ( streamTuple ) => (
2116+ streamTuple . participant . state === 'Connected' &&
21132117 < div key = { utils . getIdentifierText ( streamTuple . participant . identifier ) } >
2114- < input
2115- type = "checkbox"
2116- checked = { streamTuple . isPinned }
2117- onChange = { ( e ) => this . handleVideoPin ( streamTuple , e ) }
2118- />
2119- { utils . getIdentifierText ( streamTuple . participant . identifier ) }
2118+ < input
2119+ type = "checkbox"
2120+ checked = { streamTuple . isPinned }
2121+ onChange = { ( e ) => this . handleVideoPin ( streamTuple , e ) }
2122+ />
2123+ { utils . getIdentifierText ( streamTuple . participant . identifier ) }
21202124 </ div >
21212125 ) ) }
21222126 </ div >
You can’t perform that action at this time.
0 commit comments