Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 0578e03

Browse files
committed
Use custom reaction shortcode in the aria-label of the reaction buttons
Signed-off-by: Sumner Evans <sumner@beeper.com>
1 parent a8e5033 commit 0578e03

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/views/messages/ReactionsRowButton.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,21 @@ export default class ReactionsRowButton extends React.PureComponent<IProps, ISta
109109
let label: string | undefined;
110110
if (room) {
111111
const senders: string[] = [];
112+
let customReactionName = "";
112113
for (const reactionEvent of reactionEvents) {
113114
const member = room.getMember(reactionEvent.getSender()!);
114115
senders.push(member?.name || reactionEvent.getSender()!);
116+
if (reactionEvent.event.content?.["com.beeper.reaction.shortcode"]) {
117+
customReactionName = reactionEvent.event.content?.["com.beeper.reaction.shortcode"];
118+
}
115119
}
116120

117121
const reactors = formatCommaSeparatedList(senders, 6);
118122
if (content) {
119-
label = _t("%(reactors)s reacted with %(content)s", { reactors, content });
123+
label = _t("%(reactors)s reacted with %(content)s", {
124+
reactors,
125+
content: customReactionName || content,
126+
});
120127
} else {
121128
label = reactors;
122129
}

0 commit comments

Comments
 (0)