Skip to content

Commit

Permalink
hotfix(Agenda): ensure displayed booked sessions are not in the past
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Sep 22, 2024
1 parent 3cdd903 commit f858b25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/modals/Agenda/Agenda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React from "react";

import AgendaEntry from "@/components/modals/Agenda/AgendaSession";
import { PLANNED_SESSIONS_NEXT_WHOLE_WEEKS } from "@/lib/consts";
import { capitalizeFirstCharacter } from "@/lib/helpers/date";
import { capitalizeFirstCharacter, isClassInThePast } from "@/lib/helpers/date";
import { classConfigRecurrentId, classRecurrentId } from "@/lib/helpers/recurrentId";
import { formatNameArray } from "@/lib/utils/arrayUtils";
import { ChainIdentifier, ChainProfile } from "@/types/chain";
Expand Down Expand Up @@ -95,7 +95,9 @@ export default function Agenda({
);
const bookedSessionsDayMap = mapClassesByStartTime(
userSessions.filter(
(_class) => _class.status === SessionStatus.WAITLIST || _class.status === SessionStatus.BOOKED,
(_class) =>
!isClassInThePast(_class.classData) &&
(_class.status === SessionStatus.WAITLIST || _class.status === SessionStatus.BOOKED),
),
);
const missingClassConfigs = searchForGhosts(userSessions, chainConfigs);
Expand Down

0 comments on commit f858b25

Please sign in to comment.