[screenshare]: improve screenshare service findOne calls

This commit is contained in:
prlanzarin 2020-08-26 19:53:23 +00:00
parent f24460192c
commit 69e5891624

View File

@ -41,8 +41,14 @@ const viewScreenshare = (hasAudio) => {
};
const screenshareHasAudio = () => {
return Screenshare.findOne({ meetingId: Auth.meetingID },
{ fields: { 'screenshare.hasAudio': 1 } }).screenshare.hasAudio;
const screenshareEntry = Screenshare.findOne({ meetingId: Auth.meetingID },
{ fields: { 'screenshare.hasAudio': 1 } });
if (!screenshareEntry) {
return false;
}
return !!screenshareEntry.screenshare.hasAudio;
}
// if remote screenshare has been started connect and display the video stream