Cockatrice/webclient/src/websocket/events/SessionEvents/ListRooms.tsx
Jeremy Letto 8db9475804
Cleanup and refactor (#4361)
* fix three panel layout height issue

* rename websocket/services to websocket/persistence, implement LeaveRoom

* cleanup

* add new line eof

* move route components from /components to /containers

* remove duplicate style

Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
2021-05-18 23:06:41 -04:00

16 lines
No EOL
388 B
TypeScript

import * as _ from "lodash";
export const ListRooms = {
id: ".Event_ListRooms.ext",
action: ({ roomList }, webClient) => {
webClient.persistence.room.updateRooms(roomList);
if (webClient.options.autojoinrooms) {
_.each(roomList, ({ autoJoin, roomId }) => {
if (autoJoin) {
webClient.commands.session.joinRoom(roomId);
}
});
}
}
};