diff --git a/components/users/ProfilePictureUpload.tsx b/components/users/ProfilePictureUpload.tsx index 103c8f9e..33285573 100644 --- a/components/users/ProfilePictureUpload.tsx +++ b/components/users/ProfilePictureUpload.tsx @@ -31,6 +31,11 @@ export function ProfilePictureUpload({ const [showCropper, setShowCropper] = useState(false) const fileInputRef = useRef(null) + // Update preview when currentAvatarUrl changes + React.useEffect(() => { + setPreviewUrl(currentAvatarUrl || null) + }, [currentAvatarUrl]) + const getInitials = () => { if (firstName && lastName) { return `${firstName[0]}${lastName[0]}` diff --git a/components/users/PublicProfileView.tsx b/components/users/PublicProfileView.tsx index 88762742..09878161 100644 --- a/components/users/PublicProfileView.tsx +++ b/components/users/PublicProfileView.tsx @@ -5,7 +5,7 @@ import { useAuth } from '@/lib/hooks/useAuth' import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' -import { Avatar, AvatarFallback } from '@/components/ui/avatar' +import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' import { ContributionGraph } from '@/components/ui/contribution-graph' import { useContributionGraph } from '@/hooks/useContributionGraph' import { usePublicProfileByUsername } from '@/hooks/useProfile' @@ -149,6 +149,7 @@ export function PublicProfileView({ username }: PublicProfileViewProps) {
+ {profile.avatar_url && } {getInitials()} @@ -232,6 +233,7 @@ export function PublicProfileView({ username }: PublicProfileViewProps) {
+ {profile.avatar_url && } {getInitials()}