diff --git a/components/testimony/TestimonyDetailPage/PolicyActions.tsx b/components/testimony/TestimonyDetailPage/PolicyActions.tsx index 959d48777..b3636a961 100644 --- a/components/testimony/TestimonyDetailPage/PolicyActions.tsx +++ b/components/testimony/TestimonyDetailPage/PolicyActions.tsx @@ -129,7 +129,10 @@ export const PolicyActions: FC> = ({ setFollowStatus(prev => ({ ...prev, [topicName]: false })) } + const { t } = useTranslation("testimony") + const isFollowing = followStatus[topicName] + const isUnverified = !!user && !isUser && !user.emailVerified const text = isFollowing ? "Unfollow" : "Follow" const checkmark = isFollowing ? ( @@ -159,13 +162,19 @@ export const PolicyActions: FC> = ({ items.push( ) - const { t } = useTranslation("testimony") - return ( { if (!router.isReady) return + if (user && !user.emailVerified) { + void router.replace(`/profile?id=${user.uid}`) + return + } + const ballotQuestionId = typeof router.query.ballotQuestionId === "string" ? router.query.ballotQuestionId @@ -62,7 +68,7 @@ function SubmitTestimonyPage() { return () => { active = false } - }, [router]) + }, [router, user]) if (!isAllowed) return null