(prejoin): fix mobile

This commit is contained in:
Vlad Piersec 2020-06-19 16:21:00 +03:00 committed by Saúl Ibarra Corretgé
parent 74e0e10928
commit 0aa54d8650
2 changed files with 6 additions and 2 deletions

View File

@ -234,7 +234,7 @@ export function getVideoDeviceIds(state: Object) {
}
/**
* Returns true if there are devices of a specific type.
* Returns true if there are devices of a specific type or on native platform.
*
* @param {Object} state - The state of the application.
* @param {string} type - The type of device: VideoOutput | audioOutput | audioInput.
@ -242,6 +242,10 @@ export function getVideoDeviceIds(state: Object) {
* @returns {boolean}
*/
export function hasAvailableDevices(state: Object, type: string) {
if (state['features/base/devices'] === undefined) {
return true;
}
return state['features/base/devices'].availableDevices[type].length > 0;
}

View File

@ -18,7 +18,7 @@ MiddlewareRegistry.register(store => next => action => {
if (action.type === UPDATE_DEVICE_LIST) {
const state = store.getState();
const { popupDialogData } = state['features/device-selection'];
const { availableDevices } = state['features/base/devices'];
const { availableDevices } = state['features/base/devices'] || {};
if (popupDialogData) {
popupDialogData.transport.sendEvent({