ref(audio-picker): fetch audio devices after mount

Per react migration docs, initially fetching external data is
recommended to be done in componentDidMount.
pull/3584/head
Leonard Kim 7 years ago committed by Leonard Kim
parent d5fb2c2717
commit 3a32f7f3f0
  1. 4
      react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js

@ -109,7 +109,7 @@ class AudioRoutePickerDialog extends Component<Props, State> {
state = {
/**
* Available audio devices, it will be set in
* {@link #componentWillMount()}.
* {@link #componentDidMount()}.
*/
devices: []
};
@ -132,7 +132,7 @@ class AudioRoutePickerDialog extends Component<Props, State> {
*
* @inheritdoc
*/
componentWillMount() {
componentDidMount() {
AudioMode.getAudioDevices().then(({ devices, selected }) => {
const audioDevices = [];

Loading…
Cancel
Save