Skip to content

Commit f759f6d

Browse files
committed
fix(spaces): filter out the current parent space from the /hierarchy responses and SpaceServiceRoomList instances
1 parent e740400 commit f759f6d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

crates/matrix-sdk-ui/src/spaces/room_list.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,16 @@ impl SpaceServiceRoomList {
155155
result
156156
.rooms
157157
.iter()
158-
.map(|room| {
159-
(
160-
&room.summary,
161-
self.client.get_room(&room.summary.room_id),
162-
room.children_state.len(),
163-
)
164-
})
165-
.map(|(summary, room, children_count)| {
166-
SpaceServiceRoom::new_from_summary(summary, room, children_count as u64)
158+
.flat_map(|room| {
159+
if room.summary.room_id == self.parent_space_id {
160+
None
161+
} else {
162+
Some(SpaceServiceRoom::new_from_summary(
163+
&room.summary,
164+
self.client.get_room(&room.summary.room_id),
165+
room.children_state.len() as u64,
166+
))
167+
}
167168
})
168169
.collect::<Vec<_>>(),
169170
);

0 commit comments

Comments
 (0)