Skip to content

Scheduling infrastructure for absolutely everyone.

fix: prevents warnings on branding call when unauthed (#10051)

Omar Lópeza2e0d44fb87b
diff --git a/packages/features/ee/organizations/hooks/index.ts b/packages/features/ee/organizations/hooks/index.ts
index bbaac3a8f50..7a09b7f7fa9 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;
}