fix message reaction count visibility (#1382)

close #1367
*  Only show when the user is author, admin or has reacted to the message for all pages.
*  Add disabled state when user is author
This commit is contained in:
notmd
2023-02-09 19:31:04 +09:00
committed by GitHub
parent 7b16ee9a75
commit c8f567e930
4 changed files with 45 additions and 12 deletions
@@ -116,7 +116,8 @@ export function MessageTableEntry({ message, enabled, highlight }: MessageTableE
key={emoji}
emoji={{ name: emoji, count }}
checked={emojiState.user_emojis.includes(emoji)}
showCount={emojiState.user_emojis.filter((emoji) => emoji === "+1" || emoji === "-1").length > 0}
userReacted={emojiState.user_emojis.length > 0}
userIsAuthor={message.user_is_author}
onClick={() => react(emoji, !emojiState.user_emojis.includes(emoji))}
/>
);