Skip to content

Commit

Permalink
fix: make it possible to skip the plan gate after Stripe checkout (#162)
Browse files Browse the repository at this point in the history
we really don't want to show the plan gate if we just finished Stripe
checkout - sometimes Stripe isn't fast enough with the webhook so this
will help us provide a UX that makes sense even in this case
  • Loading branch information
travis authored Dec 12, 2024
1 parent 0253b05 commit b399b37
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/PlanGate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { TopLevelLoader } from './Loader';
import { Logo } from '@/brand';
import { usePlan } from '@/hooks';
import { useRecordRefcode, useReferredBy } from '@/lib/referrals/hooks';
import { useSearchParams } from 'next/navigation';

export function PlanGate ({ children }: { children: ReactNode }): ReactNode {
const [{ accounts }] = useW3()
Expand Down Expand Up @@ -64,7 +65,8 @@ export function PlanGate ({ children }: { children: ReactNode }): ReactNode {
}

export function MaybePlanGate ({ children }: { children: ReactNode }): ReactNode {
if (process.env.NEXT_PUBLIC_DISABLE_PLAN_GATE == 'true') {
const params = useSearchParams()
if ((process.env.NEXT_PUBLIC_DISABLE_PLAN_GATE == 'true') || (params.get('checkout') === 'true')) {
return children
} else {
return <PlanGate>{children}</PlanGate>
Expand Down

0 comments on commit b399b37

Please sign in to comment.