feat: submit own style index on realtime user state set

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-03-25 11:08:29 +01:00
parent b538c2c2a3
commit 24b7514e25
8 changed files with 157 additions and 91 deletions

View file

@ -11,10 +11,14 @@ import type { RealtimeUser } from '@hedgedoc/commons'
/**
* Dispatches an event to add a user
*/
export const setRealtimeUsers = (users: RealtimeUser[]): void => {
export const setRealtimeUsers = (users: RealtimeUser[], ownStyleIndex: number, ownDisplayName: string): void => {
const action: SetRealtimeUsersAction = {
type: RealtimeStatusActionType.SET_REALTIME_USERS,
users
users,
ownUser: {
styleIndex: ownStyleIndex,
displayName: ownDisplayName
}
}
store.dispatch(action)
}