Skip to content

Commit b399b37

Browse files
authored
fix: make it possible to skip the plan gate after Stripe checkout (#162)
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
1 parent 0253b05 commit b399b37

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/PlanGate.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { TopLevelLoader } from './Loader';
77
import { Logo } from '@/brand';
88
import { usePlan } from '@/hooks';
99
import { useRecordRefcode, useReferredBy } from '@/lib/referrals/hooks';
10+
import { useSearchParams } from 'next/navigation';
1011

1112
export function PlanGate ({ children }: { children: ReactNode }): ReactNode {
1213
const [{ accounts }] = useW3()
@@ -64,7 +65,8 @@ export function PlanGate ({ children }: { children: ReactNode }): ReactNode {
6465
}
6566

6667
export function MaybePlanGate ({ children }: { children: ReactNode }): ReactNode {
67-
if (process.env.NEXT_PUBLIC_DISABLE_PLAN_GATE == 'true') {
68+
const params = useSearchParams()
69+
if ((process.env.NEXT_PUBLIC_DISABLE_PLAN_GATE == 'true') || (params.get('checkout') === 'true')) {
6870
return children
6971
} else {
7072
return <PlanGate>{children}</PlanGate>

0 commit comments

Comments
 (0)