Clean up lifecycle methods
parent
87b114fccc
commit
36b7e45f05
|
|
@ -172,27 +172,21 @@ class Filmstrip extends React.PureComponent
|
|||
window.removeEventListener('resize', this.updateDimensions);
|
||||
}
|
||||
|
||||
componentWillUpdate(nextProps)
|
||||
{
|
||||
if (nextProps !== this.props)
|
||||
{
|
||||
if (
|
||||
nextProps.activeSpeakerId != null &&
|
||||
nextProps.activeSpeakerId !== this.props.myId
|
||||
)
|
||||
{
|
||||
// eslint-disable-next-line react/no-did-update-set-state
|
||||
this.setState({
|
||||
lastSpeaker : nextProps.activeSpeakerId
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps)
|
||||
{
|
||||
if (prevProps !== this.props)
|
||||
{
|
||||
if (
|
||||
this.props.activeSpeakerId != null &&
|
||||
this.props.activeSpeakerId !== this.props.myId
|
||||
)
|
||||
{
|
||||
// eslint-disable-next-line react/no-did-update-set-state
|
||||
this.setState({
|
||||
lastSpeaker : this.props.activeSpeakerId
|
||||
});
|
||||
}
|
||||
|
||||
this.updateDimensions();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,14 +31,16 @@ export default class PeerAudio extends React.PureComponent
|
|||
this._setOutputDevice(audioOutputDevice);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line camelcase
|
||||
UNSAFE_componentWillReceiveProps(nextProps)
|
||||
componentDidUpdate(prevProps)
|
||||
{
|
||||
const { audioTrack, audioOutputDevice } = nextProps;
|
||||
if (prevProps !== this.props)
|
||||
{
|
||||
const { audioTrack, audioOutputDevice } = this.props;
|
||||
|
||||
this._setTrack(audioTrack);
|
||||
this._setOutputDevice(audioOutputDevice);
|
||||
}
|
||||
}
|
||||
|
||||
_setTrack(audioTrack)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -345,12 +345,15 @@ class VideoView extends React.PureComponent
|
|||
}
|
||||
}
|
||||
|
||||
componentWillUpdate()
|
||||
componentDidUpdate(prevProps)
|
||||
{
|
||||
if (prevProps !== this.props)
|
||||
{
|
||||
const { videoTrack, audioTrack } = this.props;
|
||||
|
||||
this._setTracks(videoTrack, audioTrack);
|
||||
}
|
||||
}
|
||||
|
||||
_setTracks(videoTrack, audioTrack)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue