Fix typings
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user