Hide empty chat action bar overlays
Changelog-Fixed: Fixed an issue where an empty dot would appear on some thread chat views Signed-off-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Closes: https://github.com/damus-io/damus/issues/3368
This commit is contained in:
@@ -185,10 +185,18 @@ struct EventActionBar: View {
|
|||||||
let should_hide_repost = hide_items_without_activity && bar.boosts == 0
|
let should_hide_repost = hide_items_without_activity && bar.boosts == 0
|
||||||
let should_hide_reactions = hide_items_without_activity && bar.likes == 0
|
let should_hide_reactions = hide_items_without_activity && bar.likes == 0
|
||||||
let zap_model = self.damus_state.events.get_cache_data(self.event.id).zaps_model
|
let zap_model = self.damus_state.events.get_cache_data(self.event.id).zaps_model
|
||||||
let should_hide_zap = hide_items_without_activity && zap_model.zap_total > 0
|
let should_hide_zap = hide_items_without_activity && zap_model.zap_total == 0
|
||||||
let should_hide_share_button = hide_items_without_activity
|
let should_hide_share_button = hide_items_without_activity
|
||||||
|
// Only render the bar if at least one action is visible; avoids empty overlays/dots.
|
||||||
|
let has_any_action = (!should_hide_chat_bubble && damus_state.keypair.privkey != nil)
|
||||||
|
|| !should_hide_repost
|
||||||
|
|| (show_like && !should_hide_reactions)
|
||||||
|
|| (!should_hide_zap && self.lnurl != nil)
|
||||||
|
|| !should_hide_share_button
|
||||||
|
|
||||||
return HStack(spacing: options.contains(.no_spread) ? 10 : 0) {
|
return Group {
|
||||||
|
if has_any_action {
|
||||||
|
HStack(spacing: options.contains(.no_spread) ? 10 : 0) {
|
||||||
if damus_state.keypair.privkey != nil && !should_hide_chat_bubble {
|
if damus_state.keypair.privkey != nil && !should_hide_chat_bubble {
|
||||||
self.reply_button
|
self.reply_button
|
||||||
}
|
}
|
||||||
@@ -214,6 +222,8 @@ struct EventActionBar: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var content: some View {
|
var content: some View {
|
||||||
if options.contains(.swipe_action_menu) {
|
if options.contains(.swipe_action_menu) {
|
||||||
|
|||||||
Reference in New Issue
Block a user