Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
type ProjectInfo,
useProjects,
} from "@features/projects/hooks/useProjects";
import { useFeatureFlag } from "@hooks/useFeatureFlag";
import {
ArrowLeft,
ArrowRight,
Expand All @@ -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";
Expand Down Expand Up @@ -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<Org[]>(() => {
if (!fullUser?.organizations) return [];
Expand Down Expand Up @@ -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);
Expand Down
Loading