Skip to content

Commit

Permalink
clients: Check avatar_url for Gravatar host more explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
birkjernstrom committed Dec 17, 2024
1 parent 3afd419 commit a90d02b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clients/packages/polarkit/src/components/ui/atoms/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const Avatar = ({
width?: number | undefined
}) => {
const initials = getInitials(name)
const isGravatar = avatar_url && avatar_url.includes("gravatar.com")
const avatarHost = avatar_url ? new URL(avatar_url).host : null
const isGravatar = avatarHost == "www.gravatar.com"
// Always add initials below image in case of Gravatar since they return a transparent image if the user does not have a Gravatar account
const showInitials = isGravatar || !avatar_url

Expand Down

0 comments on commit a90d02b

Please sign in to comment.