Merge pull request #6055 from matrix-org/t3chguy/fix/17332

Fix space room hierarchy not updating when removing a room
This commit is contained in:
Michael Telatynski 2021-05-19 12:28:11 +01:00 committed by GitHub
commit 9b01e1575d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -471,8 +471,12 @@ export const SpaceHierarchy: React.FC<IHierarchyProps> = ({
try {
for (const [parentId, childId] of selectedRelations) {
await cli.sendStateEvent(parentId, EventType.SpaceChild, {}, childId);
parentChildMap.get(parentId).get(childId).content = {};
parentChildMap.set(parentId, new Map(parentChildMap.get(parentId)));
parentChildMap.get(parentId).delete(childId);
if (parentChildMap.get(parentId).size > 0) {
parentChildMap.set(parentId, new Map(parentChildMap.get(parentId)));
} else {
parentChildMap.delete(parentId);
}
}
} catch (e) {
setError(_t("Failed to remove some rooms. Try again later"));