fix: pass onboardingfalse (#27806)
This commit is contained in:
@@ -9,10 +9,11 @@ import { useOnboardingStore } from "../store/onboarding-store";
|
||||
type UseCreateTeamOptions = {
|
||||
redirectBasePath?: string;
|
||||
skipRedirectAfterInvite?: boolean;
|
||||
isOnboarding?: boolean;
|
||||
};
|
||||
|
||||
export function useCreateTeam(options: UseCreateTeamOptions = {}) {
|
||||
const { redirectBasePath = "/onboarding/teams", skipRedirectAfterInvite = false } = options;
|
||||
const { redirectBasePath = "/onboarding/teams", skipRedirectAfterInvite = false, isOnboarding = true } = options;
|
||||
const router = useRouter();
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const flags = useFlagMap();
|
||||
@@ -42,7 +43,7 @@ export function useCreateTeam(options: UseCreateTeamOptions = {}) {
|
||||
slug: teamDetails.slug,
|
||||
bio: teamDetails.bio,
|
||||
logo: teamBrand.logo,
|
||||
isOnboarding: true,
|
||||
isOnboarding,
|
||||
});
|
||||
|
||||
// If there's a checkout URL, redirect to Stripe payment
|
||||
|
||||
@@ -28,7 +28,10 @@ export const CreateNewTeamView = ({ userEmail }: CreateNewTeamViewProps) => {
|
||||
const { t } = useLocale();
|
||||
const store = useOnboardingStore();
|
||||
const { teamDetails, teamBrand, setTeamDetails, setTeamBrand, resetOnboardingPreservingPlan } = store;
|
||||
const { createTeam, isSubmitting } = useCreateTeam({ redirectBasePath: "/settings/teams/new" });
|
||||
const { createTeam, isSubmitting } = useCreateTeam({
|
||||
redirectBasePath: "/settings/teams/new",
|
||||
isOnboarding: false
|
||||
});
|
||||
|
||||
const logoRef = useRef<HTMLInputElement>(null);
|
||||
const [teamName, setTeamName] = useState("");
|
||||
|
||||
@@ -43,6 +43,7 @@ export const TeamInviteEmailView = ({ userEmail }: TeamInviteEmailViewProps) =>
|
||||
const { inviteMembers, isSubmitting } = useCreateTeam({
|
||||
redirectBasePath: "/settings/teams/new",
|
||||
skipRedirectAfterInvite: true,
|
||||
isOnboarding: false,
|
||||
});
|
||||
|
||||
// Read teamId from query params and store it (from payment callback or redirect)
|
||||
|
||||
@@ -29,7 +29,10 @@ export const TeamInviteView = ({ userEmail }: TeamInviteViewProps) => {
|
||||
|
||||
const store = useOnboardingStore();
|
||||
const { setTeamInvites, teamDetails, setTeamId, teamId, resetOnboardingPreservingPlan } = store;
|
||||
const { isSubmitting } = useCreateTeam({ redirectBasePath: "/settings/teams/new" });
|
||||
const { isSubmitting } = useCreateTeam({
|
||||
redirectBasePath: "/settings/teams/new",
|
||||
isOnboarding: false
|
||||
});
|
||||
const [isCSVModalOpen, setIsCSVModalOpen] = React.useState(false);
|
||||
|
||||
// Read teamId from query params and store it (from payment callback)
|
||||
|
||||
Reference in New Issue
Block a user