damus

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

commit 1154cec7195a060fe4035309e81575abf609a093
parent 1ecfb0487ef59a865f37278339717ef47c597b9c
Author: Swift <scoder1747@gmail.com>
Date:   Mon, 16 Jan 2023 21:29:07 -0500

Avoid showing reboost alert for pubkey user

Closes: #337
Changelog-Fixed: Don't show report alert if logged in as a pubkey

Diffstat:
Mdamus/Models/DamusState.swift | 5+++++
Mdamus/Views/ActionBar/EventActionBar.swift | 2+-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/damus/Models/DamusState.swift b/damus/Models/DamusState.swift @@ -22,6 +22,11 @@ struct DamusState { var pubkey: String { return keypair.pubkey } + + var is_privkey_user: Bool { + keypair.privkey != nil + } + static var empty: DamusState { return DamusState.init(pool: RelayPool(), keypair: Keypair(pubkey: "", privkey: ""), likes: EventCounter(our_pubkey: ""), boosts: EventCounter(our_pubkey: ""), contacts: Contacts(our_pubkey: ""), tips: TipCounter(our_pubkey: ""), profiles: Profiles(), dms: DirectMessagesModel(), previews: PreviewCache()) diff --git a/damus/Views/ActionBar/EventActionBar.swift b/damus/Views/ActionBar/EventActionBar.swift @@ -41,7 +41,7 @@ struct EventActionBar: View { EventActionButton(img: "arrow.2.squarepath", col: bar.boosted ? Color.green : nil) { if bar.boosted { notify(.delete, bar.our_boost) - } else { + } else if damus_state.is_privkey_user { self.confirm_boost = true } }.overlay {