mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 00:11:01 +00:00
Show reaction count alongside like count
This commit is contained in:
parent
620e852ac2
commit
835734b394
@ -926,6 +926,11 @@ pub fn render_note_inner(
|
||||
},
|
||||
)
|
||||
.unwrap_or_default();
|
||||
let reaction_count: usize = note
|
||||
.reactions
|
||||
.iter()
|
||||
.filter_map(|(c, s)| if *c == '+' { None } else { Some(s) })
|
||||
.sum();
|
||||
let mut response = widgets::clickable_label(
|
||||
ui,
|
||||
can_sign,
|
||||
@ -934,7 +939,7 @@ pub fn render_note_inner(
|
||||
response |= widgets::clickable_label(
|
||||
ui,
|
||||
can_sign,
|
||||
format!("{}", like_count),
|
||||
format!("{}+{}", like_count, reaction_count),
|
||||
);
|
||||
let hover_ui = |ui: &mut Ui| {
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
|
@ -1896,7 +1896,7 @@ impl Storage {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let symbol: char = if reaction=="" {
|
||||
let symbol: char = if reaction == "" {
|
||||
'+'
|
||||
} else if reaction.starts_with(":") && reaction.ends_with(":") {
|
||||
'□' // placeholder for custom reaction that we don't support
|
||||
|
Loading…
Reference in New Issue
Block a user