From 8b843ac45cc415676641b66dbfb21329c3f7c962 Mon Sep 17 00:00:00 2001 From: molvqingtai Date: Wed, 2 Oct 2024 23:40:12 +0800 Subject: [PATCH] fix: multiple tabs display duplicate online users --- src/domain/Room.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain/Room.ts b/src/domain/Room.ts index 709aad3..9e24b43 100644 --- a/src/domain/Room.ts +++ b/src/domain/Room.ts @@ -237,9 +237,9 @@ const RoomDomain = Remesh.domain({ impl: ({ get }, action: { type: 'create' | 'delete'; user: RoomUser }) => { const userList = get(UserListState()) if (action.type === 'create') { - return [UserListState().new(upsert(userList, action.user, 'peerId'))] + return [UserListState().new(upsert(userList, action.user, 'userId'))] } else { - return [UserListState().new(userList.filter(({ peerId }) => peerId !== action.user.peerId))] + return [UserListState().new(userList.filter(({ userId }) => userId !== action.user.userId))] } } })