From 0df78a278e67c0fb74571baa86a2050dbac6de6e Mon Sep 17 00:00:00 2001 From: Sal Tijerina Date: Fri, 1 Nov 2024 09:35:10 -0500 Subject: [PATCH] update event modal log when events are processed --- .../onboarding/layouts/OnboardingAdminLayout.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/src/onboarding/layouts/OnboardingAdminLayout.tsx b/client/src/onboarding/layouts/OnboardingAdminLayout.tsx index 75344941e9..2abd2e1a23 100644 --- a/client/src/onboarding/layouts/OnboardingAdminLayout.tsx +++ b/client/src/onboarding/layouts/OnboardingAdminLayout.tsx @@ -255,6 +255,21 @@ const OnboardingAdminTable: React.FC<{ step: TOnboardingStep; } | null>(null); + // Update modal step data if the user is updated + useEffect(() => { + if (eventLogModalParams?.user && data) { + setEventLogModalParams({ + user: eventLogModalParams.user, + step: + data.users + .find((user) => user.username === eventLogModalParams.user.username) + ?.steps.find( + (step) => step.step === eventLogModalParams.step.step + ) || eventLogModalParams.step, + }); + } + }, [data]); + if (isLoading) { return ; }