fix: when leaving space, do not leave analytics rooms (#1973)
This commit is contained in:
parent
e9bfcbe88a
commit
8400c42f01
1 changed files with 6 additions and 1 deletions
|
|
@ -2,10 +2,15 @@ part of "pangea_room_extension.dart";
|
|||
|
||||
extension EventsRoomExtension on Room {
|
||||
Future<void> leaveSpace() async {
|
||||
if (!isSpace) {
|
||||
debugPrint("room is not a space!");
|
||||
return;
|
||||
}
|
||||
|
||||
for (final child in spaceChildren) {
|
||||
if (child.roomId == null) continue;
|
||||
final Room? room = client.getRoomById(child.roomId!);
|
||||
if (room == null) continue;
|
||||
if (room == null || room.isAnalyticsRoom) continue;
|
||||
try {
|
||||
await room.leave();
|
||||
} catch (e, s) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue