ref(device-selection): change audio preview listener on component update

This commit is contained in:
Leonard Kim 2018-10-28 19:10:58 -07:00 committed by Leonard Kim
parent 280178f5d1
commit c28c70fb2f
1 changed files with 3 additions and 3 deletions

View File

@ -63,9 +63,9 @@ class AudioInputPreview extends Component<Props, State> {
* @inheritdoc
* @returns {void}
*/
componentWillReceiveProps(nextProps: Props) {
if (nextProps.track !== this.props.track) {
this._listenForAudioUpdates(nextProps.track);
componentDidUpdate(prevProps: Props) {
if (prevProps.track !== this.props.track) {
this._listenForAudioUpdates(this.props.track);
this._updateAudioLevel(0);
}
}