Preact: Show spotlight rooms on rooms list (#2476)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run

This commit is contained in:
Aurastic 2025-07-22 16:28:05 +05:30 committed by GitHub
parent aa5d8ca1a4
commit 30a3bba112
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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],
];