Skip to content

Commit

Permalink
Update condition for hidden inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
RubLo committed Jul 1, 2024
1 parent 7c1b635 commit 634e1dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/web/pages/booking/[uid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,17 @@ export default function Success(props: SuccessProps) {
</div>
</>
)}
{sessionStatus === "authenticated" &&
customInputs &&
{customInputs &&
Object.keys(customInputs).map((key) => {
// This breaks if you have two label that are the same.
// TODO: Fix this in another PR
const customInput = customInputs[key as keyof typeof customInputs];
const eventTypeCustomFound = eventType.customInputs?.find((ci) => ci.label === key);
const showHiddenInputs =
eventTypeCustomFound?.type === "HIDDEN" && sessionStatus === "authenticated";
if (!showHiddenInputs) {
return null;
}
return (
<>
{eventTypeCustomFound?.type === "RADIO" && (
Expand Down

0 comments on commit 634e1dd

Please sign in to comment.