|
@@ -5,7 +5,6 @@ import { processExternalDeviceRequest } from '../../device-selection';
|
5
|
5
|
import { showNotification, showWarningNotification } from '../../notifications';
|
6
|
6
|
import { replaceAudioTrackById, replaceVideoTrackById, setDeviceStatusWarning } from '../../prejoin/actions';
|
7
|
7
|
import { isPrejoinPageVisible } from '../../prejoin/functions';
|
8
|
|
-import { CONFERENCE_JOINED } from '../conference';
|
9
|
8
|
import { JitsiTrackErrors } from '../lib-jitsi-meet';
|
10
|
9
|
import { MiddlewareRegistry } from '../redux';
|
11
|
10
|
import { updateSettings } from '../settings';
|
|
@@ -24,6 +23,7 @@ import {
|
24
|
23
|
setVideoInputDevice
|
25
|
24
|
} from './actions';
|
26
|
25
|
import {
|
|
26
|
+ areDeviceLabelsInitialized,
|
27
|
27
|
formatDeviceLabel,
|
28
|
28
|
groupDevicesByKind,
|
29
|
29
|
setAudioOutputDeviceId
|
|
@@ -73,8 +73,6 @@ function logDeviceList(deviceList) {
|
73
|
73
|
// eslint-disable-next-line no-unused-vars
|
74
|
74
|
MiddlewareRegistry.register(store => next => action => {
|
75
|
75
|
switch (action.type) {
|
76
|
|
- case CONFERENCE_JOINED:
|
77
|
|
- return _conferenceJoined(store, next, action);
|
78
|
76
|
case NOTIFY_CAMERA_ERROR: {
|
79
|
77
|
if (typeof APP !== 'object' || !action.error) {
|
80
|
78
|
break;
|
|
@@ -148,6 +146,9 @@ MiddlewareRegistry.register(store => next => action => {
|
148
|
146
|
break;
|
149
|
147
|
case UPDATE_DEVICE_LIST:
|
150
|
148
|
logDeviceList(groupDevicesByKind(action.devices));
|
|
149
|
+ if (areDeviceLabelsInitialized(store.getState())) {
|
|
150
|
+ return _processPendingRequests(store, next, action);
|
|
151
|
+ }
|
151
|
152
|
break;
|
152
|
153
|
case CHECK_AND_NOTIFY_FOR_NEW_DEVICE:
|
153
|
154
|
_checkAndNotifyForNewDevice(store, action.newDevices, action.oldDevices);
|
|
@@ -170,11 +171,15 @@ MiddlewareRegistry.register(store => next => action => {
|
170
|
171
|
* @private
|
171
|
172
|
* @returns {Object} The value returned by {@code next(action)}.
|
172
|
173
|
*/
|
173
|
|
-function _conferenceJoined({ dispatch, getState }, next, action) {
|
|
174
|
+function _processPendingRequests({ dispatch, getState }, next, action) {
|
174
|
175
|
const result = next(action);
|
175
|
176
|
const state = getState();
|
176
|
177
|
const { pendingRequests } = state['features/base/devices'];
|
177
|
178
|
|
|
179
|
+ if (!pendingRequests || pendingRequests.length === 0) {
|
|
180
|
+ return result;
|
|
181
|
+ }
|
|
182
|
+
|
178
|
183
|
pendingRequests.forEach(request => {
|
179
|
184
|
processExternalDeviceRequest(
|
180
|
185
|
dispatch,
|