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 da5fdb5
Showing 1 changed file with 8 additions and 1 deletion.
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,6 +272,10 @@ export default {
},

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

0 comments on commit da5fdb5

Please sign in to comment.