diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index 9de3a0f35..929431f1b 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -492,8 +492,13 @@ class _SpaceViewState extends State { ) { final List filteredChildren = []; for (final child in hierarchyResponse) { - if (child.roomId == widget.spaceId || - Matrix.of(context).client.getRoomById(child.roomId) != null) { + if (child.roomId == widget.spaceId) { + continue; + } + + final room = Matrix.of(context).client.getRoomById(child.roomId); + if (room != null && room.membership != Membership.leave) { + // If the room is already joined or invited, skip it continue; }