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

This commit is contained in:
Leonard Kim
2018-11-21 08:08:45 -08:00
committed by Leonard Kim
parent 280178f5d1
commit c28c70fb2f
@@ -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);
}
}