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

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

Loading…
Cancel
Save