mirror of
https://github.com/owncast/owncast.git
synced 2024-11-26 14:56:14 +03:00
e50b23d081
* chore(js): be stricter about dead code warnings * chore(js): remove dead code and unused exports * rebase * chore: remove unused files * chore(deps): remove unused prop-types dep * chore(js): remove unused function * chore(deps): remove + check unused deps * chore(js): remove unused exports. Closes #3036
18 lines
528 B
TypeScript
18 lines
528 B
TypeScript
import { ConnectedClientInfoEvent } from '../../../interfaces/socket-events';
|
|
|
|
export function handleConnectedClientInfoMessage(
|
|
message: ConnectedClientInfoEvent,
|
|
setChatAuthenticated: (boolean) => void,
|
|
setCurrentUser: (CurrentUser) => void,
|
|
) {
|
|
const { user } = message;
|
|
const { id, displayName, displayColor, scopes, authenticated } = user;
|
|
setChatAuthenticated(authenticated);
|
|
|
|
setCurrentUser({
|
|
id: id.toString(),
|
|
displayName,
|
|
displayColor,
|
|
isModerator: scopes?.includes('MODERATOR'),
|
|
});
|
|
}
|