Avoid showing reboost alert for pubkey user

Closes: #337
Changelog-Fixed: Don't show report alert if logged in as a pubkey
This commit is contained in:
Swift
2023-01-16 21:29:07 -05:00
committed by William Casarin
parent 1ecfb0487e
commit 1154cec719
2 changed files with 6 additions and 1 deletions

View File

@@ -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())

View File

@@ -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 {