1- import { AnyAction } from 'redux' ;
2-
31import { IStore } from '../../app/types' ;
4- import { processExternalDeviceRequest } from '../../device-selection/functions' ;
2+ import { processExternalDeviceRequest } from '../../device-selection/functions.web ' ;
53import { showNotification , showWarningNotification } from '../../notifications/actions' ;
64import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants' ;
7- import { replaceAudioTrackById , replaceVideoTrackById , setDeviceStatusWarning } from '../../prejoin/actions' ;
8- import { isPrejoinPageVisible } from '../../prejoin/functions' ;
5+ import { replaceAudioTrackById , replaceVideoTrackById , setDeviceStatusWarning } from '../../prejoin/actions.web ' ;
6+ import { isPrejoinPageVisible } from '../../prejoin/functions.web ' ;
97import { APP_WILL_MOUNT , APP_WILL_UNMOUNT } from '../app/actionTypes' ;
108import { isMobileBrowser } from '../environment/utils' ;
119import JitsiMeetJS , { JitsiMediaDevicesEvents , JitsiTrackErrors } from '../lib-jitsi-meet' ;
1210import { MEDIA_TYPE } from '../media/constants' ;
1311import MiddlewareRegistry from '../redux/MiddlewareRegistry' ;
1412import { updateSettings } from '../settings/actions' ;
15- import { getLocalTrack } from '../tracks/functions' ;
13+ import { getLocalTrack } from '../tracks/functions.web ' ;
1614
1715import {
1816 CHECK_AND_NOTIFY_FOR_NEW_DEVICE ,
@@ -27,13 +25,13 @@ import {
2725 removePendingDeviceRequests ,
2826 setAudioInputDevice ,
2927 setVideoInputDevice
30- } from './actions' ;
28+ } from './actions.web ' ;
3129import {
3230 areDeviceLabelsInitialized ,
3331 formatDeviceLabel ,
3432 logDevices ,
3533 setAudioOutputDeviceId
36- } from './functions' ;
34+ } from './functions.web ' ;
3735import logger from './logger' ;
3836
3937const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = {
@@ -176,12 +174,16 @@ MiddlewareRegistry.register(store => next => action => {
176174 }
177175 break ;
178176 }
179- case UPDATE_DEVICE_LIST :
177+ case UPDATE_DEVICE_LIST : {
178+ const result = next ( action ) ;
179+
180180 logDevices ( action . devices , 'Device list updated' ) ;
181181 if ( areDeviceLabelsInitialized ( store . getState ( ) ) ) {
182- return _processPendingRequests ( store , next , action ) ;
182+ _processPendingRequests ( store ) ;
183183 }
184- break ;
184+
185+ return result ;
186+ }
185187 case CHECK_AND_NOTIFY_FOR_NEW_DEVICE :
186188 _checkAndNotifyForNewDevice ( store , action . newDevices , action . oldDevices ) ;
187189 break ;
@@ -196,20 +198,15 @@ MiddlewareRegistry.register(store => next => action => {
196198 *
197199 * @param {Store } store - The redux store in which the specified {@code action}
198200 * is being dispatched.
199- * @param {Dispatch } next - The redux {@code dispatch} function to dispatch the
200- * specified {@code action} to the specified {@code store}.
201- * @param {Action } action - The redux action {@code CONFERENCE_JOINED} which is
202- * being dispatched in the specified {@code store}.
203201 * @private
204- * @returns {Object } The value returned by { @code next(action)}.
202+ * @returns {void }
205203 */
206- function _processPendingRequests ( { dispatch, getState } : IStore , next : Function , action : AnyAction ) {
207- const result = next ( action ) ;
204+ function _processPendingRequests ( { dispatch, getState } : IStore ) {
208205 const state = getState ( ) ;
209206 const { pendingRequests } = state [ 'features/base/devices' ] ;
210207
211208 if ( ! pendingRequests || pendingRequests . length === 0 ) {
212- return result ;
209+ return ;
213210 }
214211
215212 pendingRequests . forEach ( ( request : any ) => {
@@ -220,8 +217,6 @@ function _processPendingRequests({ dispatch, getState }: IStore, next: Function,
220217 request . responseCallback ) ;
221218 } ) ;
222219 dispatch ( removePendingDeviceRequests ( ) ) ;
223-
224- return result ;
225220}
226221
227222/**
0 commit comments