From d77ba193083f8cc0dbc7ebaa638cc13a7272fbc2 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 3 Apr 2024 17:58:37 +0800 Subject: [PATCH] Handle another kind of emojiReaction response Can't everyone just standardize the responses? --- src/components/status.jsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 6ce567c..2d73982 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -1943,7 +1943,24 @@ function Status({ {!!emojiReactions?.length && (
{emojiReactions.map((emojiReaction) => { - const { name, count, me } = emojiReaction; + const { name, count, me, url, staticUrl } = emojiReaction; + if (url) { + // Some servers return url and staticUrl + return ( + + {' '} + {count} + + ); + } const isShortCode = /^:.+?:$/.test(name); if (isShortCode) { const emoji = emojis.find( @@ -1962,7 +1979,7 @@ function Status({ alt={name} url={emoji.url} staticUrl={emoji.staticUrl} - /> + />{' '} {count} );