Skip to content

Commit 34ef347

Browse files
committed
fix: Invalid left-hand side in assignment
1 parent 03aa24f commit 34ef347

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/hooks/useAudioControl.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,14 @@ export function useAudioControl(options: UseAudioControlOptions) {
112112
}, [])
113113

114114
const mute = useCallback(() => {
115-
;(audioElementRef?.current as HTMLAudioElement).muted = true
115+
if (audioElementRef.current) {
116+
audioElementRef.current.muted = true
117+
}
116118
}, [])
117119
const unmute = useCallback(() => {
118-
;(audioElementRef?.current as HTMLAudioElement).muted = false
120+
if (audioElementRef.current) {
121+
audioElementRef.current.muted = false
122+
}
119123
}, [])
120124

121125
return {

0 commit comments

Comments
 (0)