Skip to content

Commit 6db1aa2

Browse files
committed
Fix(Reactions): add dynamic order by count
Signed-off-by: DorraJaouad <[email protected]>
1 parent 64f909c commit 6db1aa2

File tree

1 file changed

+9
-1
lines changed
  • src/components/MessagesList/MessagesGroup/Message/MessagePart

1 file changed

+9
-1
lines changed

Diff for: src/components/MessagesList/MessagesGroup/Message/MessagePart/Reactions.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<template>
2424
<!-- reactions buttons and popover with details -->
2525
<div class="reactions-wrapper">
26-
<NcPopover v-for="reaction in Object.keys(detailedReactions ?? plainReactions)"
26+
<NcPopover v-for="reaction in reactionsSorted"
2727
:key="reaction"
2828
:delay="200"
2929
:focus-trap="false"
@@ -136,6 +136,14 @@ export default {
136136
return this.$store.getters.message(this.token, this.id).reactionsSelf
137137
},
138138

139+
reactionsSorted() {
140+
return this.detailedReactions
141+
? Object.keys(this.detailedReactions)
142+
.sort((a, b) => this.detailedReactions[b].length - this.detailedReactions[a].length)
143+
: Object.keys(this.plainReactions)
144+
.sort((a, b) => this.plainReactions[b] - this.plainReactions[a])
145+
},
146+
139147
/**
140148
* Compare the plain reactions with the simplified detailed reactions.
141149
*/

0 commit comments

Comments
 (0)