1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-13 07:42:14 +03:00

Apply prettier formatting

This commit is contained in:
Michael Weimann
2022-12-09 09:38:20 +01:00
parent 08a9073bd5
commit 349c2c2587
239 changed files with 22004 additions and 21928 deletions

View File

@@ -66,7 +66,7 @@ export class RoomHierarchy {
}
public async load(pageSize = this.pageSize): Promise<IHierarchyRoom[]> {
if (this.loadRequest) return this.loadRequest.then(r => r.rooms);
if (this.loadRequest) return this.loadRequest.then((r) => r.rooms);
this.loadRequest = this.root.client.getRoomHierarchy(
this.root.roomId,
@@ -97,10 +97,10 @@ export class RoomHierarchy {
this._rooms = rooms;
}
rooms.forEach(room => {
rooms.forEach((room) => {
this.roomMap.set(room.room_id, room);
room.children_state.forEach(ev => {
room.children_state.forEach((ev) => {
if (ev.type !== EventType.SpaceChild) return;
const childRoomId = ev.state_key;
@@ -116,7 +116,7 @@ export class RoomHierarchy {
this.viaMap.set(childRoomId, new Set());
}
const vias = this.viaMap.get(childRoomId)!;
ev.content.via.forEach(via => vias.add(via));
ev.content.via.forEach((via) => vias.add(via));
}
});
});
@@ -125,7 +125,7 @@ export class RoomHierarchy {
}
public getRelation(parentId: string, childId: string): IHierarchyRelation | undefined {
return this.roomMap.get(parentId)?.children_state.find(e => e.state_key === childId);
return this.roomMap.get(parentId)?.children_state.find((e) => e.state_key === childId);
}
public isSuggested(parentId: string, childId: string): boolean | undefined {
@@ -138,12 +138,15 @@ export class RoomHierarchy {
if (backRefs?.length === 1) {
this.backRefs.delete(childId);
} else if (backRefs?.length) {
this.backRefs.set(childId, backRefs.filter(ref => ref !== parentId));
this.backRefs.set(
childId,
backRefs.filter((ref) => ref !== parentId),
);
}
const room = this.roomMap.get(parentId);
if (room) {
room.children_state = room.children_state.filter(ev => ev.state_key !== childId);
room.children_state = room.children_state.filter((ev) => ev.state_key !== childId);
}
}
}