From 39c5e3538fc120cc9a2b210d5db7dd9a6fa449c7 Mon Sep 17 00:00:00 2001 From: Chris Holder Date: Mon, 28 Oct 2024 15:11:40 -0500 Subject: [PATCH] Reader Onboarding: Hide UI unless user email is verified (#95765) --- client/reader/onboarding/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/reader/onboarding/index.tsx b/client/reader/onboarding/index.tsx index b9b4e6f207451..53bfe6cc2b7ac 100644 --- a/client/reader/onboarding/index.tsx +++ b/client/reader/onboarding/index.tsx @@ -8,7 +8,10 @@ import { READER_ONBOARDING_PREFERENCE_KEY } from 'calypso/reader/onboarding/cons import InterestsModal from 'calypso/reader/onboarding/interests-modal'; import SubscribeModal from 'calypso/reader/onboarding/subscribe-modal'; import { useSelector } from 'calypso/state'; -import { getCurrentUserDate } from 'calypso/state/current-user/selectors'; +import { + getCurrentUserDate, + isCurrentUserEmailVerified, +} from 'calypso/state/current-user/selectors'; import { getPreference, hasReceivedRemotePreferences } from 'calypso/state/preferences/selectors'; import { getReaderFollowedTags } from 'calypso/state/reader/tags/selectors'; @@ -23,12 +26,14 @@ const ReaderOnboarding = ( { onRender }: { onRender?: ( shown: boolean ) => void ); const preferencesLoaded = useSelector( hasReceivedRemotePreferences ); const userRegistrationDate = useSelector( getCurrentUserDate ); + const isEmailVerified = useSelector( isCurrentUserEmailVerified ); const shouldShowOnboarding = config.isEnabled( 'reader/onboarding' ) && preferencesLoaded && ! hasCompletedOnboarding && userRegistrationDate && + isEmailVerified && new Date( userRegistrationDate ) >= new Date( '2024-10-01T00:00:00Z' ); // Notify the parent component if onboarding will render.