fix: TypeError: Cannot read property 'isAudioTrack' of undefined

When there's no jitsiTrack set on the base/tracks entry it means
a track is being created (get user media is in progress).
This commit is contained in:
Pawel Domas 2021-02-16 16:20:44 -06:00 committed by Paweł Domas
parent 946339a52e
commit e0aab11f98
2 changed files with 4 additions and 2 deletions

View File

@ -320,7 +320,7 @@ export function getTrackByMediaTypeAndParticipant(
mediaType,
participantId) {
return tracks.find(
t => t.participantId === participantId && t.mediaType === mediaType
t => Boolean(t.jitsiTrack) && t.participantId === participantId && t.mediaType === mediaType
);
}

View File

@ -46,7 +46,9 @@ MiddlewareRegistry.register(store => next => async action => {
await dispatch(replaceLocalTrack(localVideoTrack.jitsiTrack, null));
}
const jitsiTracks = getState()['features/base/tracks'].map(t => t.jitsiTrack);
const jitsiTracks = getState()['features/base/tracks']
.map(t => t.jitsiTrack)
.filter(t => Boolean(t)); // Filter out GUM in progress tracks...
dispatch(setPrejoinPageVisibility(false));
APP.conference.prejoinStart(jitsiTracks);