Skip to content

Commit

Permalink
fix: assure correct initialPage in timetable (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
builder-247 authored Jul 19, 2024
1 parent af6e584 commit 36c7a1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elements/timetable/Timetable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const AnimatedPager = Animated.createAnimatedComponent(PagerView);

const Timetable = () => {
const [events, setEvents] = useState<AssemblyEvent[][]>([]);
const [eventDayIndex, setEventDayIndex] = useState(0);
const [eventDayIndex, setEventDayIndex] = useState(-1);
const { favorites, toggle: toggleFavorite } = useFavorite();

const callback = useCallback((position: number) => {
Expand Down Expand Up @@ -59,7 +59,7 @@ const Timetable = () => {

return (
<View style={{ flex: 1 }}>
{events.length === 0 ? (
{events.length === 0 || eventDayIndex === -1 ? (
<ActivityIndicator animating />
) : (
<View
Expand Down

0 comments on commit 36c7a1b

Please sign in to comment.