Skip to content

Commit

Permalink
Fix recently attended events
Browse files Browse the repository at this point in the history
  • Loading branch information
raymosun committed Jan 22, 2024
1 parent 2484444 commit 9a868bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/components/profile/UserProfilePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,17 @@ export const UserProfilePage = ({
)}
</Typography>
<Carousel>
{(isSignedInUser ? signedInAttendances : (attendances as PublicAttendance[])).map(
({ event }) => (
{(isSignedInUser ? signedInAttendances : (attendances as PublicAttendance[]))
.reverse()
.slice(0, 10)
.map(({ event }) => (
<EventCard
className={styles.card}
key={event.uuid}
event={event}
attended={signedInAttendances.some(({ event: { uuid } }) => uuid === event.uuid)}
/>
)
)}
))}
</Carousel>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/u/[handle].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const getServerSidePropsFunc: GetServerSideProps = async ({ params, req, res })

let attendances = null;
if (!isSignedInUser && handleUser.isAttendancePublic)
attendances = (await UserAPI.getAttendancesForUserByUUID(token, user.uuid)).slice(0, 10);
attendances = await UserAPI.getAttendancesForUserByUUID(token, handleUser.uuid);

// render UserProfilePage
return {
Expand Down

0 comments on commit 9a868bf

Please sign in to comment.