Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: assure correct initialPage in timetable #30

Merged
merged 10 commits into from
Jul 19, 2024
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
Loading