You've already forked matrix-js-sdk
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user