Don't show subspaces in top-level spaces lists
This commit is contained in:
parent
2fbb40c8fd
commit
c96671b29b
2 changed files with 23 additions and 28 deletions
|
|
@ -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…
Add table
Reference in a new issue