From 04cbfb9d4a2294b5b58b4917fe1981c78dba7b52 Mon Sep 17 00:00:00 2001 From: tejaspanchall Date: Thu, 5 Jun 2025 19:56:08 +0530 Subject: [PATCH] anime info (desktop) resolved --- src/components/AnimeDetails.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/AnimeDetails.js b/src/components/AnimeDetails.js index 04141a9..e1ca730 100644 --- a/src/components/AnimeDetails.js +++ b/src/components/AnimeDetails.js @@ -15,6 +15,14 @@ export default function AnimeDetails({ anime }) { console.log('AnimeDetails received:', anime); + // Check if synopsis overflows when component mounts or when content changes + useEffect(() => { + if (synopsisRef.current) { + const element = synopsisRef.current; + setSynopsisOverflows(element.scrollHeight > element.clientHeight); + } + }, [anime?.info?.description, activeTab]); + if (!anime?.info) { console.error('Invalid anime data structure:', anime); return null; @@ -24,14 +32,6 @@ export default function AnimeDetails({ anime }) { const hasCharacters = info.characterVoiceActor?.length > 0 || info.charactersVoiceActors?.length > 0; const hasVideos = info.promotionalVideos && info.promotionalVideos.length > 0; - // Check if synopsis overflows when component mounts or when content changes - useEffect(() => { - if (synopsisRef.current) { - const element = synopsisRef.current; - setSynopsisOverflows(element.scrollHeight > element.clientHeight); - } - }, [info.description, activeTab]); - // Video modal for promotional videos const VideoModal = ({ video, onClose }) => { if (!video) return null;