From 77f8f85b965ca19a71110ecba255fed65308416c Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Mon, 29 Oct 2018 12:10:10 -0700 Subject: [PATCH] ref(device-selection): update preview tracks on component update --- .../components/DeviceSelection.js | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/react/features/device-selection/components/DeviceSelection.js b/react/features/device-selection/components/DeviceSelection.js index 2344896d4..ec5f03439 100644 --- a/react/features/device-selection/components/DeviceSelection.js +++ b/react/features/device-selection/components/DeviceSelection.js @@ -151,7 +151,8 @@ class DeviceSelection extends AbstractDialogTab { } /** - * Checks if audio / video permissions were granted. + * Checks if audio / video permissions were granted. Updates audio input and + * video input previews. * * @param {Object} prevProps - Previous props this component received. * @param {Object} prevState - Previous state this component had. @@ -174,25 +175,15 @@ class DeviceSelection extends AbstractDialogTab { }); }); } - } - /** - * Updates audio input and video input previews. - * - * @inheritdoc - * @param {Object} nextProps - The read-only props which this Component will - * receive. - * @returns {void} - */ - componentWillReceiveProps(nextProps: Object) { - const { selectedAudioInputId, selectedVideoInputId } = this.props; - - if (selectedAudioInputId !== nextProps.selectedAudioInputId) { - this._createAudioInputTrack(nextProps.selectedAudioInputId); + if (prevProps.selectedAudioInputId + !== this.props.selectedAudioInputId) { + this._createAudioInputTrack(this.props.selectedAudioInputId); } - if (selectedVideoInputId !== nextProps.selectedVideoInputId) { - this._createVideoInputTrack(nextProps.selectedVideoInputId); + if (prevProps.selectedVideoInputId + !== this.props.selectedVideoInputId) { + this._createVideoInputTrack(this.props.selectedVideoInputId); } }