Wire up chat message props. Add username highlighting. Closes #1921

This commit is contained in:
Gabe Kangas
2022-06-24 21:30:54 -07:00
parent b7df2949e4
commit e08037b64a
13 changed files with 141 additions and 143 deletions

View File

@@ -3,8 +3,12 @@ import { ConnectedClientInfoEvent } from '../../../interfaces/socket-events';
export default function handleConnectedClientInfoMessage(
message: ConnectedClientInfoEvent,
setChatDisplayName: (string) => void,
setChatUserId: (number) => void,
setIsChatModerator: (boolean) => void,
) {
const { user } = message;
const { displayName } = user;
const { id, displayName, scopes } = user;
setChatDisplayName(displayName);
setChatUserId(id);
setIsChatModerator(scopes.includes('moderator'));
}