From 9b7926963f9bc84706a0d3cf2177b8a64dc7fbc9 Mon Sep 17 00:00:00 2001 From: gabek Date: Mon, 26 Jul 2021 05:27:02 +0000 Subject: [PATCH] Prettified Code! --- webroot/js/components/chat/chat.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/webroot/js/components/chat/chat.js b/webroot/js/components/chat/chat.js index 04e8345e6..67767cb5b 100644 --- a/webroot/js/components/chat/chat.js +++ b/webroot/js/components/chat/chat.js @@ -151,7 +151,9 @@ export default class Chat extends Component { .then((data) => { // extra user names const allChatUserNames = extraUserNamesFromMessageHistory(data); - const chatUserNames = allChatUserNames.filter(name => name != username); + const chatUserNames = allChatUserNames.filter( + (name) => name != username + ); this.setState({ messages: data.concat(this.state.messages), chatUserNames, @@ -225,7 +227,9 @@ export default class Chat extends Component { }; const updatedAllChatUserNames = this.updateAuthorList(message); if (updatedAllChatUserNames.length) { - const updatedChatUserNames = updatedAllChatUserNames.filter(name => name != username); + const updatedChatUserNames = updatedAllChatUserNames.filter( + (name) => name != username + ); newState.chatUserNames = [...updatedChatUserNames]; } this.setState(newState); @@ -269,7 +273,7 @@ export default class Chat extends Component { type === SOCKET_MESSAGE_TYPES.CHAT && !nameList.includes(message.user.displayName) ) { - nameList.push(message.user.displayName) + nameList.push(message.user.displayName); return nameList; } else if (type === SOCKET_MESSAGE_TYPES.NAME_CHANGE) { const { oldName, newName } = message;