From 79d7eb2d9742f1cc649bd740603d1d6b32a69cc7 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 7 Jan 2025 09:21:03 +0100 Subject: [PATCH] Fix typings --- .../components/SessionDetail/CompatSessionDetail.tsx | 3 ++- .../UnverifiedEmailAlert/UnverifiedEmailAlert.tsx | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/SessionDetail/CompatSessionDetail.tsx b/frontend/src/components/SessionDetail/CompatSessionDetail.tsx index 57301414e..097c130d3 100644 --- a/frontend/src/components/SessionDetail/CompatSessionDetail.tsx +++ b/frontend/src/components/SessionDetail/CompatSessionDetail.tsx @@ -72,7 +72,8 @@ const CompatSessionDetail: React.FC = ({ session }) => { const sessionDetails = [...finishedAt]; - const clientDetails: { label: string; value: string | JSX.Element }[] = []; + const clientDetails: { label: string; value: string | React.ReactElement }[] = + []; if (data.ssoLogin?.redirectUri) { clientDetails.push({ diff --git a/frontend/src/components/UnverifiedEmailAlert/UnverifiedEmailAlert.tsx b/frontend/src/components/UnverifiedEmailAlert/UnverifiedEmailAlert.tsx index 8b8e1891c..319b0f5da 100644 --- a/frontend/src/components/UnverifiedEmailAlert/UnverifiedEmailAlert.tsx +++ b/frontend/src/components/UnverifiedEmailAlert/UnverifiedEmailAlert.tsx @@ -22,23 +22,23 @@ export const UNVERIFIED_EMAILS_FRAGMENT = graphql(/* GraphQL */ ` `); const UnverifiedEmailAlert: React.FC<{ - user?: FragmentType; + user: FragmentType; }> = ({ user }) => { const data = useFragment(UNVERIFIED_EMAILS_FRAGMENT, user); const [dismiss, setDismiss] = useState(false); const { t } = useTranslation(); - const currentCount = useRef(); + const currentCount = useRef(data.unverifiedEmails.totalCount); const doDismiss = (): void => setDismiss(true); useEffect(() => { - if (currentCount.current !== data?.unverifiedEmails?.totalCount) { - currentCount.current = data?.unverifiedEmails?.totalCount; + if (currentCount.current !== data.unverifiedEmails.totalCount) { + currentCount.current = data.unverifiedEmails.totalCount; setDismiss(false); } }, [data]); - if (!data?.unverifiedEmails?.totalCount || dismiss) { + if (!data.unverifiedEmails.totalCount || dismiss) { return null; }