Fix number of boxes being counted in updateDimensions
parent
f49f02d016
commit
a5457ecac1
|
|
@ -22,9 +22,9 @@ class Peers extends React.Component
|
||||||
|
|
||||||
updateDimensions = () =>
|
updateDimensions = () =>
|
||||||
{
|
{
|
||||||
const n = this.props.videoStreams ? this.props.videoStreams : 0;
|
const n = this.props.boxes;
|
||||||
|
|
||||||
if (n == 0)
|
if (n === 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -121,27 +121,24 @@ class Peers extends React.Component
|
||||||
}
|
}
|
||||||
|
|
||||||
Peers.propTypes =
|
Peers.propTypes =
|
||||||
{
|
{
|
||||||
advancedMode : PropTypes.bool,
|
advancedMode : PropTypes.bool,
|
||||||
peers : PropTypes.arrayOf(appPropTypes.Peer).isRequired,
|
peers : PropTypes.arrayOf(appPropTypes.Peer).isRequired,
|
||||||
videoStreams : PropTypes.any,
|
boxes : PropTypes.number,
|
||||||
activeSpeakerName : PropTypes.string,
|
activeSpeakerName : PropTypes.string,
|
||||||
toolAreaOpen : PropTypes.bool
|
toolAreaOpen : PropTypes.bool
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) =>
|
const mapStateToProps = (state) =>
|
||||||
{
|
{
|
||||||
const peersArray = Object.values(state.peers);
|
const peers = Object.values(state.peers);
|
||||||
const videoStreamsArray = Object.values(state.consumers);
|
|
||||||
const videoStreams =
|
const boxes = peers.length + Object.values(state.consumers)
|
||||||
videoStreamsArray.filter((consumer) =>
|
.filter((consumer) => consumer.source === 'screen').length;
|
||||||
{
|
|
||||||
return (consumer.source === 'webcam' || consumer.source === 'screen');
|
|
||||||
}).length;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
peers : peersArray,
|
peers,
|
||||||
videoStreams : videoStreams,
|
boxes,
|
||||||
activeSpeakerName : state.room.activeSpeakerName,
|
activeSpeakerName : state.room.activeSpeakerName,
|
||||||
toolAreaOpen : state.toolarea.toolAreaOpen
|
toolAreaOpen : state.toolarea.toolAreaOpen
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue