Update space children (best effort) when upgrading a room

This commit is contained in:
Michael Telatynski 2021-07-09 08:43:41 +01:00
parent f412fb44a7
commit 437d53d1cc
3 changed files with 60 additions and 37 deletions

View file

@ -335,6 +335,10 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
return sortBy(parents, r => r.roomId)?.[0] || null;
}
public getKnownParents(roomId: string): Set<string> {
return this.parentMap.get(roomId) || new Set();
}
public getSpaceFilteredRoomIds = (space: Room | null): Set<string> => {
if (!space && SettingsStore.getValue("feature_spaces.all_rooms")) {
return new Set(this.matrixClient.getVisibleRooms().map(r => r.roomId));