mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix: show donation page to unauthorized users (#61696)
This commit is contained in:
@@ -98,7 +98,11 @@ const GrowthBookWrapper = ({
|
||||
clientLocal: clientLocale
|
||||
};
|
||||
|
||||
if (user) {
|
||||
// Needs more checks as the user object is not empty but user is not signed in
|
||||
const isSignedIn =
|
||||
user && user.completedChallenges && user.email && user.joinDate;
|
||||
|
||||
if (isSignedIn) {
|
||||
userAttributes = {
|
||||
...userAttributes,
|
||||
staff: user.email.includes('@freecodecamp'),
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
import { PaymentContext } from '../../../shared/config/donation-settings';
|
||||
import { DonateFormState } from '../redux/types';
|
||||
import callGA from '../analytics/call-ga';
|
||||
import type { User } from '../redux/prop-types';
|
||||
interface DonatePageProps {
|
||||
isDonating?: boolean;
|
||||
showLoading: boolean;
|
||||
@@ -37,11 +38,11 @@ const mapStateToProps = createSelector(
|
||||
signInLoadingSelector,
|
||||
donationFormStateSelector,
|
||||
(
|
||||
{ isDonating }: { isDonating: boolean },
|
||||
user: User | null,
|
||||
showLoading: boolean,
|
||||
donationFormState: DonateFormState
|
||||
) => ({
|
||||
isDonating,
|
||||
isDonating: user?.isDonating || false,
|
||||
showLoading,
|
||||
donationFormState
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user