fix: multiple tabs display duplicate online users
This commit is contained in:
parent
65bf9b2419
commit
8b843ac45c
1 changed files with 2 additions and 2 deletions
|
@ -237,9 +237,9 @@ const RoomDomain = Remesh.domain({
|
||||||
impl: ({ get }, action: { type: 'create' | 'delete'; user: RoomUser }) => {
|
impl: ({ get }, action: { type: 'create' | 'delete'; user: RoomUser }) => {
|
||||||
const userList = get(UserListState())
|
const userList = get(UserListState())
|
||||||
if (action.type === 'create') {
|
if (action.type === 'create') {
|
||||||
return [UserListState().new(upsert(userList, action.user, 'peerId'))]
|
return [UserListState().new(upsert(userList, action.user, 'userId'))]
|
||||||
} else {
|
} else {
|
||||||
return [UserListState().new(userList.filter(({ peerId }) => peerId !== action.user.peerId))]
|
return [UserListState().new(userList.filter(({ userId }) => userId !== action.user.userId))]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue