Skip to content

Commit

Permalink
fix(Reactions): show all names if they are at most 4 reactions
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad committed Aug 23, 2024
1 parent a679b16 commit b4d043b
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@

<div v-if="hasReactionsLoaded" class="reaction-details">
<span>{{ getReactionSummary(reaction) }}
<a v-if="reactionsCount(reaction) > 3"
<span v-if="reactionsCount(reaction) === 4">
{{ remainingReactionsLabel(reaction) }}
</span>
<a v-else-if="reactionsCount(reaction) > 4"
class="more-reactions-button"
role="button"
tabindex="0"
Expand Down Expand Up @@ -269,7 +272,11 @@ export default {
},

remainingReactionsLabel(reaction) {
return n('spreed', 'and %n other participant', 'and %n other participants', this.reactionsCount(reaction) - 3)
const reactionsCount = this.reactionsCount(reaction)
if (reactionsCount === 4) {
return t('spreed', 'and {participant}', { participant: this.getDisplayNameForReaction(this.detailedReactions[reaction][3]) })
}
return t('spreed', 'and %n other participants', reactionsCount - 3)
},
}
}
Expand Down

0 comments on commit b4d043b

Please sign in to comment.