Skip to content

Commit

Permalink
Re-fetch events when logging in
Browse files Browse the repository at this point in the history
In case the user is on the /events page and logs in, the events should
be re-fetched to get the user registration statuses.
  • Loading branch information
ivarnakken committed Dec 12, 2024
1 parent 074860e commit 64ad6d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/routes/events/components/EventList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import EmptyState from 'app/components/EmptyState';
import EventItem from 'app/components/EventItem';
import { CheckBox, SelectInput } from 'app/components/Form/';
import { EventTime } from 'app/models';
import { useCurrentUser } from 'app/reducers/auth';
import { useCurrentUser, useIsLoggedIn } from 'app/reducers/auth';
import { selectAllEvents } from 'app/reducers/events';
import { selectPaginationNext } from 'app/reducers/selectors';
import { useAppDispatch, useAppSelector } from 'app/store/hooks';
Expand Down Expand Up @@ -134,6 +134,7 @@ const EventList = () => {
);

const icalToken = useCurrentUser()?.icalToken;
const loggedIn = useIsLoggedIn();

const fetchQuery = {
date_after: moment().format('YYYY-MM-DD'),
Expand Down Expand Up @@ -162,7 +163,7 @@ const EventList = () => {
query: fetchQuery,
}),
),
[],
[loggedIn],
);

const fetchMore = () =>
Expand Down

0 comments on commit 64ad6d0

Please sign in to comment.