fix: prevents warnings on branding call when unauthed (#10051)
parent
a9ee5d6f7f
commit
a2e0d44fb8
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue