Fix the mechanical style rules. [skip build]
This commit is contained in:
@@ -42,11 +42,12 @@ const MAX_AUTO_PAGE_COUNT = 50;
|
||||
export function buildParentByRoomId(rooms: Iterable<IHierarchyRoom>): Map<string, string> {
|
||||
const parentByRoomId = new Map<string, string>();
|
||||
for (const room of rooms) {
|
||||
if (!room?.room_id || !Array.isArray(room.children_state)) continue;
|
||||
for (const childState of room.children_state) {
|
||||
if (childState?.type !== StateEvent.SpaceChild) continue;
|
||||
if (typeof childState.state_key !== 'string') continue;
|
||||
parentByRoomId.set(childState.state_key, room.room_id);
|
||||
if (room?.room_id && Array.isArray(room.children_state)) {
|
||||
room.children_state.forEach((childState) => {
|
||||
if (childState?.type !== StateEvent.SpaceChild) return;
|
||||
if (typeof childState.state_key !== 'string') return;
|
||||
parentByRoomId.set(childState.state_key, room.room_id);
|
||||
});
|
||||
}
|
||||
}
|
||||
return parentByRoomId;
|
||||
|
||||
Reference in New Issue
Block a user