Fix reaction tooltip message
authorajbura <ajbura@gmail.com>
Fri, 4 Feb 2022 06:09:18 +0000 (11:39 +0530)
committerajbura <ajbura@gmail.com>
Fri, 4 Feb 2022 06:09:18 +0000 (11:39 +0530)
Signed-off-by: ajbura <ajbura@gmail.com>
src/app/molecules/message/Message.jsx

index 8d3b61f64eea8de65485d70dfa33db7a6ee2b473..319e9c86f3f85275235e4cd7fa1383b670077ea9 100644 (file)
@@ -304,9 +304,11 @@ function genReactionMsg(userIds, reaction) {
       {userIds.map((userId, index) => (
         <React.Fragment key={userId}>
           {twemojify(getUsername(userId))}
-          <span style={{ opacity: '.6' }}>
-            {index === userIds.length - 1 ? ' and ' : ', '}
-          </span>
+          {index < userIds.length - 1 && (
+            <span style={{ opacity: '.6' }}>
+              {index === userIds.length - 2 ? ' and ' : ', '}
+            </span>
+          )}
         </React.Fragment>
       ))}
       <span style={{ opacity: '.6' }}>{' reacted with '}</span>