From bcbbf5dcbcdd6511223e2d0ad9d99cfd97da2ecb Mon Sep 17 00:00:00 2001 From: Charles Vien Date: Tue, 5 May 2026 00:55:34 -0700 Subject: [PATCH] Skip seat provisioning on org switch when billing flag disabled --- .../features/onboarding/components/ProjectSelectStep.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/code/src/renderer/features/onboarding/components/ProjectSelectStep.tsx b/apps/code/src/renderer/features/onboarding/components/ProjectSelectStep.tsx index 60844ef22..74fa942bb 100644 --- a/apps/code/src/renderer/features/onboarding/components/ProjectSelectStep.tsx +++ b/apps/code/src/renderer/features/onboarding/components/ProjectSelectStep.tsx @@ -12,6 +12,7 @@ import { type ProjectInfo, useProjects, } from "@features/projects/hooks/useProjects"; +import { useFeatureFlag } from "@hooks/useFeatureFlag"; import { ArrowLeft, ArrowRight, @@ -30,6 +31,7 @@ import { } from "@posthog/quill"; import { Button, Flex, Spinner, Text } from "@radix-ui/themes"; import happyHog from "@renderer/assets/images/hedgehogs/happy-hog.png"; +import { BILLING_FLAG } from "@shared/constants"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { logger } from "@utils/logger"; import { AnimatePresence, motion } from "framer-motion"; @@ -72,6 +74,7 @@ export function ProjectSelectStep({ onNext, onBack }: ProjectSelectStepProps) { const client = useOptionalAuthenticatedClient(); const queryClient = useQueryClient(); const { data: fullUser } = useCurrentUser({ client }); + const billingEnabled = useFeatureFlag(BILLING_FLAG); const organizations = useMemo(() => { if (!fullUser?.organizations) return []; @@ -108,7 +111,9 @@ export function ProjectSelectStep({ onNext, onBack }: ProjectSelectStepProps) { await queryClient.invalidateQueries({ queryKey: authKeys.currentUsers(), }); - void useSeatStore.getState().fetchSeat({ autoProvision: true }); + if (billingEnabled) { + void useSeatStore.getState().fetchSeat({ autoProvision: true }); + } }, onMutate: () => { setIsSwitchingOrg(true);