Fix some chat event types breaking.

- User moderator message was no longer showing
- Name change event was breaking chat
This commit is contained in:
Gabe Kangas
2021-12-11 16:44:39 -08:00
parent c3f9f24624
commit f3a8266c99
2 changed files with 12 additions and 3 deletions

View File

@@ -35,12 +35,13 @@ export default function Message(props) {
) {
return html`<${ChatMessageView} ...${props} />`;
} else if (type === SOCKET_MESSAGE_TYPES.NAME_CHANGE) {
// User changed their name
const { displayName } = user;
const contents = html`
<>
<div>
<span class="font-bold">${oldName}</span> is now known as ${' '}
<span class="font-bold">${displayName}</span>.
</>
</div>
`;
return html`<${SystemMessage} contents=${contents} />`;
} else if (type === SOCKET_MESSAGE_TYPES.USER_JOINED) {