damus

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

commit 2348f64dff1cf8d95feeb9431110aebb02426018
parent 8428f0af438a4ce097ccc52791ab0007c23e95c8
Author: Swift <scoder1747@gmail.com>
Date:   Mon,  2 Jan 2023 18:32:33 -0800

Hide Edit Button on Profile Page for the user not logged in w/Private Key

Changelog-Fixed: Hide edit button on profile page when no private key
Closes: #215

Diffstat:
Mdamus/Views/EditMetadataView.swift | 2+-
Mdamus/Views/ProfileView.swift | 6++++--
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/damus/Views/EditMetadataView.swift b/damus/Views/EditMetadataView.swift @@ -174,7 +174,7 @@ struct EditMetadataView: View { Text(String.localizedStringWithFormat("'%@' is an invalid nip05 identifier. It should look like an email.", nip05)) } }) - + Button("Save") { save() dismiss() diff --git a/damus/Views/ProfileView.swift b/damus/Views/ProfileView.swift @@ -196,8 +196,10 @@ struct ProfileView: View { follow_state: damus_state.contacts.follow_state(profile.pubkey) ) } else { - NavigationLink(destination: EditMetadataView(damus_state: damus_state)) { - EditButton(damus_state: damus_state) + if damus_state.keypair.privkey != nil { + NavigationLink(destination: EditMetadataView(damus_state: damus_state)) { + EditButton(damus_state: damus_state) + } } }