From 4f11c215a8740a66d6fd3d7711c7288345408d80 Mon Sep 17 00:00:00 2001 From: n-hidaka <85332716+n-hidaka@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:33:02 +0900 Subject: [PATCH] fix: @typescript-eslint/no-unused-expressions --- src/conference/components/video.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conference/components/video.tsx b/src/conference/components/video.tsx index 8ac197f..e0fe108 100644 --- a/src/conference/components/video.tsx +++ b/src/conference/components/video.tsx @@ -23,8 +23,8 @@ function Video({ stream, isReverse = false, isVideoOnly = false }: Props) { } log("useEffect(): assign and play stream for video"); - $video.srcObject !== stream && ($video.srcObject = stream); - $video.paused && $video.play(); + if ($video.srcObject !== stream) $video.srcObject = stream; + if ($video.paused) $video.play(); }, [isNoVideo, videoRef, log, stream]); useEffect(() => { const $audio = audioRef.current; @@ -33,8 +33,8 @@ function Video({ stream, isReverse = false, isVideoOnly = false }: Props) { } log("useEffect(): assign and play stream for audio"); - $audio.srcObject !== stream && ($audio.srcObject = stream); - $audio.paused && $audio.play(); + if ($audio.srcObject !== stream) $audio.srcObject = stream; + if ($audio.paused) $audio.play(); }, [isNoAudio, isVideoOnly, audioRef, log, stream]); log("render()", [...stream.getTracks()]);