Add more guards against undefined
Signed-off-by: Jake Janicke <jaketripplj@gmail.com>
This commit is contained in:
@@ -269,16 +269,17 @@ export const SpotlightTile: FC<Props> = ({
|
|||||||
// isScreenShare only needs to check "audioEnabled$" but I wanted to be more specific
|
// isScreenShare only needs to check "audioEnabled$" but I wanted to be more specific
|
||||||
// just in case more models are added in the future, since screen shares always have video
|
// just in case more models are added in the future, since screen shares always have video
|
||||||
const isScreenShare =
|
const isScreenShare =
|
||||||
currentMedia &&
|
currentMedia != null &&
|
||||||
"audioEnabled$" in currentMedia &&
|
"audioEnabled$" in currentMedia &&
|
||||||
"videoEnabled$" in currentMedia;
|
"videoEnabled$" in currentMedia;
|
||||||
|
|
||||||
const hasAudio$ = useBehavior(
|
const hasAudio$ = useBehavior(
|
||||||
isScreenShare && currentMedia?.audioEnabled$
|
isScreenShare && (currentMedia as RemoteScreenShareViewModel).audioEnabled$
|
||||||
? currentMedia.audioEnabled$
|
? currentMedia.audioEnabled$
|
||||||
: constant(false),
|
: constant(false),
|
||||||
);
|
);
|
||||||
const isLocalScreenShare = isScreenShare && currentMedia.local;
|
const isLocalScreenShare =
|
||||||
|
isScreenShare && (currentMedia as RemoteScreenShareViewModel)?.local;
|
||||||
const screenShareLocallyMuted = useBehavior(
|
const screenShareLocallyMuted = useBehavior(
|
||||||
isScreenShare
|
isScreenShare
|
||||||
? (currentMedia as RemoteScreenShareViewModel).playbackMuted$
|
? (currentMedia as RemoteScreenShareViewModel).playbackMuted$
|
||||||
|
|||||||
Reference in New Issue
Block a user