From f23a1202ccca1e00642068e0c199ef09dcf207e4 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sun, 25 Jul 2021 22:41:15 -0700 Subject: [PATCH 1/2] Do not set title text for users without data. Closes #1249 --- webroot/js/components/chat/chat-message-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webroot/js/components/chat/chat-message-view.js b/webroot/js/components/chat/chat-message-view.js index adf7166e2..17459e7ef 100644 --- a/webroot/js/components/chat/chat-message-view.js +++ b/webroot/js/components/chat/chat-message-view.js @@ -48,9 +48,9 @@ export default class ChatMessageView extends Component { return null; } const formattedTimestamp = `Sent at ${formatTimestamp(timestamp)}`; - const userMetadata = `${displayName} first joined ${formatTimestamp( + const userMetadata = createdAt ? `${displayName} first joined ${formatTimestamp( createdAt - )}`; + )}` : null; const isSystemMessage = message.type === SOCKET_MESSAGE_TYPES.SYSTEM; From 8c5f7be05cfe26473003ff7d2f1c8e7be5fc2167 Mon Sep 17 00:00:00 2001 From: gabek Date: Mon, 26 Jul 2021 05:41:48 +0000 Subject: [PATCH 2/2] Prettified Code! --- webroot/js/components/chat/chat-message-view.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webroot/js/components/chat/chat-message-view.js b/webroot/js/components/chat/chat-message-view.js index 17459e7ef..6d4546859 100644 --- a/webroot/js/components/chat/chat-message-view.js +++ b/webroot/js/components/chat/chat-message-view.js @@ -48,9 +48,9 @@ export default class ChatMessageView extends Component { return null; } const formattedTimestamp = `Sent at ${formatTimestamp(timestamp)}`; - const userMetadata = createdAt ? `${displayName} first joined ${formatTimestamp( - createdAt - )}` : null; + const userMetadata = createdAt + ? `${displayName} first joined ${formatTimestamp(createdAt)}` + : null; const isSystemMessage = message.type === SOCKET_MESSAGE_TYPES.SYSTEM;