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:
@@ -23,6 +23,11 @@ struct DamusState {
|
|||||||
return keypair.pubkey
|
return keypair.pubkey
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var is_privkey_user: Bool {
|
||||||
|
keypair.privkey != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static var empty: DamusState {
|
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())
|
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())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ struct EventActionBar: View {
|
|||||||
EventActionButton(img: "arrow.2.squarepath", col: bar.boosted ? Color.green : nil) {
|
EventActionButton(img: "arrow.2.squarepath", col: bar.boosted ? Color.green : nil) {
|
||||||
if bar.boosted {
|
if bar.boosted {
|
||||||
notify(.delete, bar.our_boost)
|
notify(.delete, bar.our_boost)
|
||||||
} else {
|
} else if damus_state.is_privkey_user {
|
||||||
self.confirm_boost = true
|
self.confirm_boost = true
|
||||||
}
|
}
|
||||||
}.overlay {
|
}.overlay {
|
||||||
|
|||||||
Reference in New Issue
Block a user