damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit d1323ea15c19b0237e7f685e0c646b2164ac9a61
parent 2c44366ca5b4c297b5a22478781005230c0be1df
Author: Sam DuBois <sdubois@umass.edu>
Date:   Sat, 17 Dec 2022 10:12:32 -0700

Resolved issue where `RoboHash` image does not appear so the profile button is inaccessible

Diffstat:
Mdamus/ContentView.swift | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -197,7 +197,13 @@ struct ContentView: View { let prof_dest = ProfileView(damus_state: damus_state!, profile: profile_model, followers: followers_model) NavigationLink(destination: prof_dest) { - ProfilePicView(pubkey: damus_state!.pubkey, size: 32, highlight: .none, profiles: damus_state!.profiles) + /// Verify that the user has a profile picture, if not display a generic SF Symbol + /// (Resolves an in-app error where ``Robohash`` pictures are not generated so the button dissapears + if let picture = damus_state?.profiles.lookup(id: pubkey)?.picture { + ProfilePicView(pubkey: damus_state!.pubkey, size: 32, highlight: .none, profiles: damus_state!.profiles, picture: picture) + } else { + Image(systemName: "person.fill") + } } .buttonStyle(PlainButtonStyle()) }