Show reaction count alongside like count

This commit is contained in:
Mike Dilger 2024-08-06 11:06:37 +12:00
parent 620e852ac2
commit 835734b394
2 changed files with 7 additions and 2 deletions

View File

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

View File

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