Skip to content

Commit

Permalink
Reader Onboarding: Hide UI unless user email is verified (#95765)
Browse files Browse the repository at this point in the history
  • Loading branch information
holdercp authored Oct 28, 2024
1 parent 2f9ccaa commit 39c5e35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/reader/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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.
Expand Down

0 comments on commit 39c5e35

Please sign in to comment.