Don't show subspaces in top-level spaces lists

pull/1183/head
ggurdin 1 year ago
parent 2fbb40c8fd
commit c96671b29b

@ -138,17 +138,14 @@ class ChatListView extends StatelessWidget {
builder: (context) {
final allSpaces =
client.rooms.where((room) => room.isSpace);
// #Pangea
// final rootSpaces = allSpaces
// .where(
// (space) => !allSpaces.any(
// (parentSpace) => parentSpace.spaceChildren
// .any((child) => child.roomId == space.id),
// ),
// )
// .toList();
final rootSpaces = allSpaces.toList();
// Pangea#
final rootSpaces = allSpaces
.where(
(space) => !allSpaces.any(
(parentSpace) => parentSpace.spaceChildren
.any((child) => child.roomId == space.id),
),
)
.toList();
final destinations = getNavigationDestinations(context);
return SizedBox(
@ -228,9 +225,9 @@ class ChatListView extends StatelessWidget {
NavigationDestinationLabelBehavior.alwaysHide,
height: 64,
shadowColor:
Theme.of(context).colorScheme.onBackground,
Theme.of(context).colorScheme.onSurface,
surfaceTintColor:
Theme.of(context).colorScheme.background,
Theme.of(context).colorScheme.surface,
selectedIndex: controller.selectedIndex,
onDestinationSelected:
controller.onDestinationSelected,

@ -572,21 +572,19 @@ class _SpaceViewState extends State<SpaceView> {
final allSpaces = client.rooms.where((room) => room.isSpace);
if (activeSpaceId == null) {
final rootSpaces = allSpaces
// #Pangea
// .where(
// (space) =>
// !allSpaces.any(
// (parentSpace) => parentSpace.spaceChildren
// .any((child) => child.roomId == space.id),
// ) &&
// space
// .getLocalizedDisplayname(MatrixLocals(L10n.of(context)!))
// .toLowerCase()
// .contains(
// widget.controller.searchController.text.toLowerCase(),
// ),
//)
// Pangea#
.where(
(space) =>
!allSpaces.any(
(parentSpace) => parentSpace.spaceChildren
.any((child) => child.roomId == space.id),
) &&
space
.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!))
.toLowerCase()
.contains(
widget.controller.searchController.text.toLowerCase(),
),
)
.toList();
return SafeArea(

Loading…
Cancel
Save