From c0af312e66c3d6e76038b751cb8ad67231709fdf Mon Sep 17 00:00:00 2001 From: Travis Vachon Date: Thu, 12 Dec 2024 09:53:49 -0800 Subject: [PATCH] fix: make it possible to skip the plan gate after Stripe checkout 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 --- src/components/PlanGate.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/PlanGate.tsx b/src/components/PlanGate.tsx index 1af2b5b..669f38f 100644 --- a/src/components/PlanGate.tsx +++ b/src/components/PlanGate.tsx @@ -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() @@ -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 {children}