diff --git a/src/components/profile/ProfileView.tsx b/src/components/profile/ProfileView.tsx index 6078756..122f922 100644 --- a/src/components/profile/ProfileView.tsx +++ b/src/components/profile/ProfileView.tsx @@ -34,6 +34,7 @@ export function ProfileView() { const [profileTab, setProfileTab] = useState<"notes" | "articles" | "media">("notes"); const [bannerLightbox, setBannerLightbox] = useState(false); const [bannerLoaded, setBannerLoaded] = useState(false); + const [bannerError, setBannerError] = useState(false); const isFollowing = follows.includes(pubkey); const { mutedPubkeys, mute, unmute } = useMuteStore(); @@ -62,6 +63,8 @@ export function ProfileView() { useEffect(() => { setLoading(true); setProfileTab("notes"); + setBannerLoaded(false); + setBannerError(false); fetchUserNotesNIP65(pubkey).then((events) => { setNotes(events); setLoading(false); @@ -151,7 +154,7 @@ export function ProfileView() { {!editing && (
{/* Banner */} - {profile?.banner ? ( + {profile?.banner && !bannerError ? (
{!bannerLoaded && (
@@ -162,31 +165,33 @@ export function ProfileView() { className="w-full h-full object-cover object-[center_30%] cursor-pointer hover:opacity-90 transition-opacity" onClick={() => setBannerLightbox(true)} onLoad={() => setBannerLoaded(true)} - onError={(e) => { (e.target as HTMLImageElement).style.display = "none"; }} + onError={() => setBannerError(true)} />
) : null} - {/* Avatar + info — avatar overlaps banner when present */} -
- {avatar ? ( - { (e.target as HTMLImageElement).style.display = "none"; }} - /> - ) : ( -
- {name.charAt(0).toUpperCase()} -
- )} + {/* Avatar + info */} +
+
+ {avatar ? ( + { (e.target as HTMLImageElement).style.display = "none"; }} + /> + ) : ( +
+ {name.charAt(0).toUpperCase()} +
+ )} +
-
+
{name}
{nip05 &&
{nip05}
} {lud16 &&
⚡ {lud16}
}