diff --git a/packages/features/ee/organizations/hooks/index.ts b/packages/features/ee/organizations/hooks/index.ts index bbaac3a8f5..7a09b7f7fa 100644 --- a/packages/features/ee/organizations/hooks/index.ts +++ b/packages/features/ee/organizations/hooks/index.ts @@ -1,5 +1,12 @@ +import { useSession } from "next-auth/react"; + import { trpc } from "@calcom/trpc/react"; export function useOrgBrandingValues() { - return trpc.viewer.organizations.getBrand.useQuery().data; + const session = useSession(); + return trpc.viewer.organizations.getBrand.useQuery(undefined, { + // Only fetch if we have a session to avoid flooding logs with errors + enabled: session.status === "authenticated", + initialData: null, + }).data; }