Skip to content

Commit

Permalink
update event modal log when events are processed
Browse files Browse the repository at this point in the history
  • Loading branch information
rstijerina committed Nov 1, 2024
1 parent dec15c4 commit 0df78a2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions client/src/onboarding/layouts/OnboardingAdminLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Spinner />;
}
Expand Down

0 comments on commit 0df78a2

Please sign in to comment.