Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix issue with external images (#1334)

Luke Vella33385f90397d
diff --git a/apps/web/src/components/current-user-avatar.tsx b/apps/web/src/components/current-user-avatar.tsx
index 54ba8f7d2..53adcedeb 100644
--- a/apps/web/src/components/current-user-avatar.tsx
+++ b/apps/web/src/components/current-user-avatar.tsx
@@ -1,5 +1,5 @@
"use client";
-import { Avatar, AvatarFallback } from "@rallly/ui/avatar";
+import { Avatar, AvatarFallback, AvatarImage } from "@rallly/ui/avatar";
import Image from "next/image";
import { useUser } from "@/components/user-provider";
@@ -24,14 +24,18 @@ export const CurrentUserAvatar = ({
return (
<Avatar className={className} style={{ width: size, height: size }}>
{user.image ? (
- <Image
- src={getAvatarUrl(user.image)}
- width={128}
- height={128}
- alt={user.name}
- style={{ objectFit: "cover" }}
- objectFit="cover"
- />
+ user.image.startsWith("http") ? (
+ <AvatarImage src={user.image} />
+ ) : (
+ <Image
+ src={getAvatarUrl(user.image)}
+ width={128}
+ height={128}
+ alt={user.name}
+ style={{ objectFit: "cover" }}
+ objectFit="cover"
+ />
+ )
) : (
<AvatarFallback>{user.name[0]}</AvatarFallback>
)}