From 6cb32224762f5e902b5f9fc1cac01cb37b799560 Mon Sep 17 00:00:00 2001 From: kmichel Date: Thu, 18 Apr 2024 16:08:16 -0700 Subject: [PATCH] prettier --- src/components/VideoPlayer/BaseVideoPlayer.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index 0480ee4314e9..04e9eaeae12f 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -174,14 +174,15 @@ function BaseVideoPlayer({ // use `useLayoutEffect` instead of `useEffect` because ref is null when unmount in `useEffect` hook // ref url: https://reactjs.org/blog/2020/08/10/react-v17-rc.html#effect-cleanup-timing - useLayoutEffect(() => - () => { - if(shouldUseSharedVideoElement || videoPlayerRef.current !== currentVideoPlayerRef.current) { + useLayoutEffect( + () => () => { + if (shouldUseSharedVideoElement || videoPlayerRef.current !== currentVideoPlayerRef.current) { return; } currentVideoPlayerRef.current = null; - } - , [currentVideoPlayerRef, shouldUseSharedVideoElement]); + }, + [currentVideoPlayerRef, shouldUseSharedVideoElement], + ); useEffect(() => { if (!isUploading || !videoPlayerRef.current) { @@ -214,7 +215,7 @@ function BaseVideoPlayer({ } return; } - + videoPlayerRef.current = currentVideoPlayerRef.current; if (currentlyPlayingURL === url && newParentRef && 'appendChild' in newParentRef) { newParentRef.appendChild(sharedElement as HTMLDivElement);