mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Preact: Show spotlight rooms on rooms list (#2476)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
This commit is contained in:
parent
aa5d8ca1a4
commit
30a3bba112
|
|
@ -106,11 +106,15 @@ class RoomsPanel extends PSRoomPanel {
|
|||
|
||||
if (!searchid) {
|
||||
const roomsCache = PS.mainmenu.roomsCache;
|
||||
const officialRooms = [], chatRooms = [], hiddenRooms = [];
|
||||
let spotLightLabel = '';
|
||||
const officialRooms = [], chatRooms = [], hiddenRooms = [], spotLightRooms = [];
|
||||
for (const room of roomsCache.chat || []) {
|
||||
if (room.section !== this.section && this.section !== '') continue;
|
||||
if (room.privacy === 'hidden') {
|
||||
hiddenRooms.push(room);
|
||||
} else if (room.spotlight) {
|
||||
spotLightLabel = room.spotlight;
|
||||
spotLightRooms.push(room);
|
||||
} else if (room.section === 'Official') {
|
||||
officialRooms.push(room);
|
||||
} else {
|
||||
|
|
@ -119,6 +123,7 @@ class RoomsPanel extends PSRoomPanel {
|
|||
}
|
||||
return [
|
||||
["Official chat rooms", officialRooms],
|
||||
[spotLightLabel, spotLightRooms],
|
||||
["Chat rooms", chatRooms],
|
||||
["Hidden rooms", hiddenRooms],
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user