mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-06 05:27:54 -05:00
Friends: Ensure the spectator list only includes battles with your friend as a player
This commit is contained in:
parent
d4cec9736f
commit
953fcde2fa
|
|
@ -613,8 +613,11 @@ export const pages: Chat.PageTable = {
|
|||
for (const friend of friends) {
|
||||
const curBattles: [User, string][] = [...friend.inRooms]
|
||||
.filter(id => {
|
||||
const room = Rooms.get(id)?.battle;
|
||||
return room && (!room.roomid.endsWith('pw') || friend.settings.displayBattlesToFriends);
|
||||
const battle = Rooms.get(id)?.battle;
|
||||
return (
|
||||
battle && battle.playerTable[friend.id] &&
|
||||
(!battle.roomid.endsWith('pw') || friend.settings.displayBattlesToFriends)
|
||||
);
|
||||
})
|
||||
.map(id => [friend, id]);
|
||||
if (!curBattles.length) continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user