Skip to content

Commit e740400

Browse files
committed
change(spaces): put a limit of 1 on the max depth of the /hierarchy calls so only the direct children are fetche
1 parent e23bdee commit e740400

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use eyeball::{SharedObservable, Subscriber};
1818
use futures_util::pin_mut;
1919
use matrix_sdk::{Client, Error, paginators::PaginationToken};
2020
use matrix_sdk_common::executor::{JoinHandle, spawn};
21-
use ruma::{OwnedRoomId, api::client::space::get_hierarchy};
21+
use ruma::{OwnedRoomId, api::client::space::get_hierarchy, uint};
2222
use tracing::error;
2323

2424
use crate::spaces::SpaceServiceRoom;
@@ -131,6 +131,7 @@ impl SpaceServiceRoomList {
131131
self.pagination_state.set(SpaceServiceRoomListPaginationState::Loading);
132132

133133
let mut request = get_hierarchy::v1::Request::new(self.parent_space_id.clone());
134+
request.max_depth = Some(uint!(1)); // We only want the immediate children of the space
134135

135136
if let PaginationToken::HasMore(ref token) = *self.token.lock().unwrap() {
136137
request.from = Some(token.clone());

0 commit comments

Comments
 (0)