Fix avatar for org in Shell top (#10712)

pull/10462/head^2
Hariom Balhara 2023-08-12 05:49:27 +05:30 committed by GitHub
parent 07f803e758
commit f84f1f5dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import classNames from "@calcom/lib/classNames";
import { APP_NAME, DESKTOP_APP_LINK, JOIN_DISCORD, ROADMAP, WEBAPP_URL } from "@calcom/lib/constants"; import { APP_NAME, DESKTOP_APP_LINK, JOIN_DISCORD, ROADMAP, WEBAPP_URL } from "@calcom/lib/constants";
import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage"; import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
import getBrandColours from "@calcom/lib/getBrandColours"; import getBrandColours from "@calcom/lib/getBrandColours";
import { useBookerUrl } from "@calcom/lib/hooks/useBookerUrl";
import { useIsomorphicLayoutEffect } from "@calcom/lib/hooks/useIsomorphicLayoutEffect"; import { useIsomorphicLayoutEffect } from "@calcom/lib/hooks/useIsomorphicLayoutEffect";
import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useLocale } from "@calcom/lib/hooks/useLocale";
import { isKeyInObject } from "@calcom/lib/isKeyInObject"; import { isKeyInObject } from "@calcom/lib/isKeyInObject";
@ -111,7 +112,6 @@ function useRedirectToLoginIfUnauthenticated(isPublic = false) {
const { data: session, status } = useSession(); const { data: session, status } = useSession();
const loading = status === "loading"; const loading = status === "loading";
const router = useRouter(); const router = useRouter();
useEffect(() => { useEffect(() => {
if (isPublic) { if (isPublic) {
return; return;
@ -307,6 +307,8 @@ function UserDropdown({ small }: UserDropdownProps) {
const { t } = useLocale(); const { t } = useLocale();
const { data: user } = useMeQuery(); const { data: user } = useMeQuery();
const utils = trpc.useContext(); const utils = trpc.useContext();
const bookerUrl = useBookerUrl();
useEffect(() => { useEffect(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore //@ts-ignore
@ -370,7 +372,7 @@ function UserDropdown({ small }: UserDropdownProps) {
)}> )}>
<Avatar <Avatar
size={small ? "xs" : "xsm"} size={small ? "xs" : "xsm"}
imageSrc={WEBAPP_URL + "/" + user.username + "/avatar.png"} imageSrc={bookerUrl + "/" + user.username + "/avatar.png"}
alt={user.username || "Nameless User"} alt={user.username || "Nameless User"}
className="overflow-hidden" className="overflow-hidden"
/> />