Browse Source

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

Per react migration docs, initially fetching external data is
recommended to be done in componentDidMount.
master
Leonard Kim 7 years ago
parent
commit
3a32f7f3f0

+ 2
- 2
react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js View File

109
     state = {
109
     state = {
110
         /**
110
         /**
111
          * Available audio devices, it will be set in
111
          * Available audio devices, it will be set in
112
-         * {@link #componentWillMount()}.
112
+         * {@link #componentDidMount()}.
113
          */
113
          */
114
         devices: []
114
         devices: []
115
     };
115
     };
132
      *
132
      *
133
      * @inheritdoc
133
      * @inheritdoc
134
      */
134
      */
135
-    componentWillMount() {
135
+    componentDidMount() {
136
         AudioMode.getAudioDevices().then(({ devices, selected }) => {
136
         AudioMode.getAudioDevices().then(({ devices, selected }) => {
137
             const audioDevices = [];
137
             const audioDevices = [];
138
 
138
 

Loading…
Cancel
Save