From ff9223ad958ca337f29c0b6db66f4ad6ddeea83c Mon Sep 17 00:00:00 2001 From: lashman Date: Sat, 4 Apr 2026 11:49:14 +0300 Subject: [PATCH] fix hover trailers toggle - suppress cached video key when pref disabled --- src/hooks/use-hover-trailer.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hooks/use-hover-trailer.ts b/src/hooks/use-hover-trailer.ts index af409a1..ab35ffb 100644 --- a/src/hooks/use-hover-trailer.ts +++ b/src/hooks/use-hover-trailer.ts @@ -60,8 +60,11 @@ export function useHoverTrailer( return pickPriority(a.type) - pickPriority(b.type) })[0] + // If the feature is disabled, suppress the key even when cached data + // exists from a previous session. Otherwise PosterCard will mount the + // iframe the moment the user hovers. return { - videoKey: trailer?.key || null, - ready: armed && (movieQ.isFetched || tvQ.isFetched), + videoKey: enabled && armed && trailer?.key ? trailer.key : null, + ready: enabled && armed && (movieQ.isFetched || tvQ.isFetched), } }