Skip to content

Commit

Permalink
Fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Jan 7, 2025
1 parent e685dab commit 79d7eb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 79d7eb2

Please sign in to comment.