fix: undefined accesses causes crashes in actions-bar breakout utils

Multiple undefined accesses in actions-bar's service, mainly related to
breakouts and ageneral Meetings info, cause crashes in production
environments - most likely in reconnection scenarios.

Guarantee that nested data is safely accessed.
This commit is contained in:
prlanzarin 2024-04-30 14:40:28 -03:00
parent be96230894
commit 2084392ac7

View File

@ -61,15 +61,15 @@ export default {
},
}),
meetingName: () => Meetings.findOne({ meetingId: Auth.meetingID },
{ fields: { 'meetingProp.name': 1 } }).meetingProp.name,
{ fields: { 'meetingProp.name': 1 } })?.meetingProp?.name,
users: () => Users.find({
meetingId: Auth.meetingID,
clientType: { $ne: DIAL_IN_USER },
}).fetch(),
groups: () => Meetings.findOne({ meetingId: Auth.meetingID },
{ fields: { groups: 1 } }).groups,
{ fields: { groups: 1 } })?.groups,
isBreakoutRecordable: () => Meetings.findOne({ meetingId: Auth.meetingID },
{ fields: { 'breakoutProps.record': 1 } }).breakoutProps.record,
{ fields: { 'breakoutProps.record': 1 } })?.breakoutProps?.record,
toggleRecording: () => makeCall('toggleRecording'),
createBreakoutRoom: (rooms, durationInMinutes, record = false, captureNotes = false, captureSlides = false, sendInviteToModerators = false) => makeCall('createBreakoutRoom', rooms, durationInMinutes, record, captureNotes, captureSlides, sendInviteToModerators),
sendInvitation: (breakoutId, userId) => makeCall('requestJoinURL', { breakoutId, userId }),