From 8f375dc645698ad9a0d37cd5ee36d7ee61f668a3 Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Sat, 13 Jan 2024 21:55:16 +0530 Subject: [PATCH] Fix initialSeason being set to specials --- src/routes/series/index.jsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/routes/series/index.jsx b/src/routes/series/index.jsx index b2b3afc..9ed1ca5 100644 --- a/src/routes/series/index.jsx +++ b/src/routes/series/index.jsx @@ -226,6 +226,19 @@ const SeriesTitlePage = () => { } }, [item.isSuccess]); + useLayoutEffect(() => { + if (seasons.isSuccess) { + if ( + seasons.data.TotalRecordCount > 1 && + seasons.data.Items[0].Name.toLowerCase().includes("special") + ) { + setCurrentSeason(1); + } else { + setCurrentSeason(0); + } + } + }, [seasons.isSuccess]); + if (item.isPending || similarItems.isPending) { return (