Skip to content

Commit

Permalink
feature(multiplayer) Show avatars for every connection instead of eve…
Browse files Browse the repository at this point in the history
…ry user.

- `MultiplayerUserBar` now only filters the entries for `others` by exclusing the
  current Liveblocks `connectionId`.
  • Loading branch information
seanparsons committed Jan 10, 2024
1 parent 6b2cb42 commit 5c4f8cf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions editor/src/components/user-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,17 @@ const MultiplayerUserBar = React.memo(() => {
const dispatch = useDispatch()
const collabs = useStorage((store) => store.collaborators)

const { user: myUser } = useMyUserAndPresence()
const { user: myUser, presence: myPresence } = useMyUserAndPresence()

const others = useOthers((list) =>
normalizeOthersList(myUser.id, list).map((other) => {
return {
...getCollaborator(collabs, other),
following: other.presence.following,
}
}),
list
.filter((entry) => entry.connectionId !== myPresence.connectionId)
.map((other) => {
return {
...getCollaborator(collabs, other),
following: other.presence.following,
}
}),
)

const visibleOthers = React.useMemo(() => {
Expand Down

0 comments on commit 5c4f8cf

Please sign in to comment.