From 18d444d2e73736546b06157dc4408561e2b2896c Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 21 May 2019 13:54:06 +0100 Subject: [PATCH] Remove reacted with text when shortcode missing If we don't have the shortcode for some emoji, don't show any "reacted with X" text in the reaction tooltip. Fixes https://github.com/vector-im/riot-web/issues/9786 --- src/components/views/messages/ReactionsRowButtonTooltip.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/ReactionsRowButtonTooltip.js b/src/components/views/messages/ReactionsRowButtonTooltip.js index 394812fd38..b70724d516 100644 --- a/src/components/views/messages/ReactionsRowButtonTooltip.js +++ b/src/components/views/messages/ReactionsRowButtonTooltip.js @@ -46,7 +46,7 @@ export default class ReactionsRowButtonTooltip extends React.PureComponent { const { name } = room.getMember(reactionEvent.getSender()); senders.push(name); } - const shortName = unicodeToShortcode(content) || content; + const shortName = unicodeToShortcode(content); tooltipLabel =
{_t( "reacted with %(shortName)s", { @@ -59,6 +59,9 @@ export default class ReactionsRowButtonTooltip extends React.PureComponent {
; }, reactedWith: (sub) => { + if (!shortName) { + return null; + } return
{sub}
;