From 634e1ddd29025396786d515e64b01ef7c44e4a96 Mon Sep 17 00:00:00 2001 From: rublo Date: Mon, 1 Jul 2024 11:42:19 +0200 Subject: [PATCH] Update condition for hidden inputs --- apps/web/pages/booking/[uid].tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsx index e3850a8f54cc34..d288df029dd2ee 100644 --- a/apps/web/pages/booking/[uid].tsx +++ b/apps/web/pages/booking/[uid].tsx @@ -495,13 +495,17 @@ export default function Success(props: SuccessProps) { )} - {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" && (