From ef1bc3e64cb116dc3e3ac2bf12e72752b0258070 Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Wed, 27 Nov 2024 12:41:56 +0530 Subject: [PATCH] Issue #PS-2651 bug: Creating extra/planned session needs to refresh page for second session- fix --- src/components/PlannedSession.tsx | 18 ++++++++++-------- src/pages/centers/[cohortId]/index.tsx | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/PlannedSession.tsx b/src/components/PlannedSession.tsx index 04e30502..3404b5b5 100644 --- a/src/components/PlannedSession.tsx +++ b/src/components/PlannedSession.tsx @@ -1512,14 +1512,16 @@ const PlannedSession: React.FC = ({ // days: // block?.selectedWeekDays?.join(', ') || // editSession?.recurrencePattern?.daysOfWeek, - days: (editSession?.recurrencePattern?.daysOfWeek || []) - .map( - (dayIndex: any) => - ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][ - dayIndex - ] - ) - .join(', '), + days: + block?.selectedWeekDays?.join(', ') || + (editSession?.recurrencePattern?.daysOfWeek || []) + .map( + (dayIndex: any) => + ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][ + dayIndex + ] + ) + .join(', '), })} diff --git a/src/pages/centers/[cohortId]/index.tsx b/src/pages/centers/[cohortId]/index.tsx index 26661626..6fe7b554 100644 --- a/src/pages/centers/[cohortId]/index.tsx +++ b/src/pages/centers/[cohortId]/index.tsx @@ -196,7 +196,7 @@ const CohortPage = () => { }; const handleCloseSchedule = () => { - setEventCreated(true); + setEventCreated((prev) => !prev); handleClose(); };