瀏覽代碼

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

Per react migration docs, initially fetching external data is
recommended to be done in componentDidMount.
j8
Leonard Kim 7 年之前
父節點
當前提交
3a32f7f3f0
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js

+ 2
- 2
react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js 查看文件

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

Loading…
取消
儲存