Fix typings

This commit is contained in:
Quentin Gliech
2025-01-07 09:21:03 +01:00
parent 7a6ea004ae
commit ef9e76b69e
2 changed files with 7 additions and 6 deletions

View File

@@ -72,7 +72,8 @@ const CompatSessionDetail: React.FC<Props> = ({ 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({

View File

@@ -22,23 +22,23 @@ export const UNVERIFIED_EMAILS_FRAGMENT = graphql(/* GraphQL */ `
`);
const UnverifiedEmailAlert: React.FC<{
user?: FragmentType<typeof UNVERIFIED_EMAILS_FRAGMENT>;
user: FragmentType<typeof UNVERIFIED_EMAILS_FRAGMENT>;
}> = ({ user }) => {
const data = useFragment(UNVERIFIED_EMAILS_FRAGMENT, user);
const [dismiss, setDismiss] = useState(false);
const { t } = useTranslation();
const currentCount = useRef<number>();
const currentCount = useRef<number>(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;
}