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), } }