From 36c7a1bdde9c027d8c4fa92106e72914ca6c5015 Mon Sep 17 00:00:00 2001 From: builder_247 <14019974+builder-247@users.noreply.github.com> Date: Fri, 19 Jul 2024 10:34:14 +0300 Subject: [PATCH] fix: assure correct initialPage in timetable (#30) --- elements/timetable/Timetable.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elements/timetable/Timetable.tsx b/elements/timetable/Timetable.tsx index b6a5b51..0181865 100644 --- a/elements/timetable/Timetable.tsx +++ b/elements/timetable/Timetable.tsx @@ -13,7 +13,7 @@ const AnimatedPager = Animated.createAnimatedComponent(PagerView); const Timetable = () => { const [events, setEvents] = useState([]); - const [eventDayIndex, setEventDayIndex] = useState(0); + const [eventDayIndex, setEventDayIndex] = useState(-1); const { favorites, toggle: toggleFavorite } = useFavorite(); const callback = useCallback((position: number) => { @@ -59,7 +59,7 @@ const Timetable = () => { return ( - {events.length === 0 ? ( + {events.length === 0 || eventDayIndex === -1 ? ( ) : (