From d1323ea15c19b0237e7f685e0c646b2164ac9a61 Mon Sep 17 00:00:00 2001 From: Sam DuBois Date: Sat, 17 Dec 2022 10:12:32 -0700 Subject: [PATCH] Resolved issue where `RoboHash` image does not appear so the profile button is inaccessible --- damus/ContentView.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/damus/ContentView.swift b/damus/ContentView.swift index 013e178d..ac8a863e 100644 --- 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()) }