disable multiple team creation for self-hosters

This commit is contained in:
KMKoushik
2024-10-20 08:25:48 +11:00
parent 2391d1c306
commit 2db31cda35
7 changed files with 18 additions and 36 deletions

View File

@@ -4,7 +4,6 @@ import { useSession } from "next-auth/react";
import { FullScreenLoading } from "~/components/FullScreenLoading";
import { AddSesSettings } from "~/components/settings/AddSesSettings";
import CreateTeam from "~/components/team/CreateTeam";
import TeamCreationDisabled from "~/components/team/TeamCreationDisabled";
import { env } from "~/env";
import { api } from "~/trpc/react";
@@ -27,14 +26,6 @@ export const DashboardProvider = ({
return <FullScreenLoading />;
}
if (
!env.NEXT_PUBLIC_IS_CLOUD &&
!env.NEXT_PUBLIC_SELF_HOSTED_ALLOW_NEW_USERS &&
(!teams || teams.length === 0)
) {
return <TeamCreationDisabled />;
}
if (
settings?.length === 0 &&
(!env.NEXT_PUBLIC_IS_CLOUD || session?.user.isAdmin)