Update selector and containers. Peers now don't jump around on the screen when active speaker changes.
This commit is contained in:
@@ -519,17 +519,17 @@ Peer.propTypes =
|
||||
theme : PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
const makeMapStateToProps = (initialState, props) =>
|
||||
const makeMapStateToProps = (initialState, { id }) =>
|
||||
{
|
||||
const getPeerConsumers = makePeerConsumerSelector();
|
||||
|
||||
const mapStateToProps = (state) =>
|
||||
{
|
||||
return {
|
||||
peer : state.peers[props.id],
|
||||
...getPeerConsumers(state, props),
|
||||
peer : state.peers[id],
|
||||
...getPeerConsumers(state, id),
|
||||
windowConsumer : state.room.windowConsumer,
|
||||
activeSpeaker : props.id === state.room.activeSpeakerId
|
||||
activeSpeaker : id === state.room.activeSpeakerId
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -190,13 +190,13 @@ SpeakerPeer.propTypes =
|
||||
classes : PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = (state, props) =>
|
||||
const mapStateToProps = (state, { id }) =>
|
||||
{
|
||||
const getPeerConsumers = makePeerConsumerSelector();
|
||||
|
||||
return {
|
||||
peer : state.peers[props.id],
|
||||
...getPeerConsumers(state, props)
|
||||
peer : state.peers[id],
|
||||
...getPeerConsumers(state, id)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user