Skip to content

Commit 15ba776

Browse files
committed
fix(OverlayScreenSaver): resolve issue with animation
1 parent 70a6059 commit 15ba776

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/webui/src/client/ui/ClockView/OverlayScreenSaver.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function OverlayScreenSaver({ studioId }: Readonly<{ studioId: StudioId }
4949

5050
const animation = motionAnimate([
5151
[el, { opacity: 1 }, { duration: 3, delay: 1 }],
52-
[el, { opacity: 1 }, { duration: 3, delay: 5 }],
52+
[el, { opacity: 0 }, { duration: 3, delay: 5 }],
5353
])
5454
animation
5555
.then(() => {
@@ -68,13 +68,13 @@ export function OverlayScreenSaver({ studioId }: Readonly<{ studioId: StudioId }
6868
animate()
6969
}
7070
return () => {
71-
if (el) {
72-
el.style.transform = ''
73-
el.style.opacity = ''
74-
el.style.position = ''
75-
el.style.left = ''
76-
animationControlsRef.current?.stop()
77-
}
71+
animationControlsRef.current?.stop()
72+
73+
if (!el) return
74+
el.style.transform = ''
75+
el.style.opacity = ''
76+
el.style.position = ''
77+
el.style.left = ''
7878
}
7979
}, [studioNameRef.current, data?.rundownPlaylist?.name, data?.studio?.name])
8080

0 commit comments

Comments
 (0)