From 363a91a193a43183ffd1a094ff4a82f98f01f7c5 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Fri, 7 Jun 2024 16:35:54 -0400 Subject: [PATCH] allow leaving for all selected chats --- lib/pages/chat_list/chat_list.dart | 8 +++++++- lib/pages/chat_list/chat_list_header.dart | 6 ++++++ lib/pages/chat_list/space_view.dart | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index db05bedf8c..f7294e571a 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -105,6 +105,12 @@ class ChatListController extends State selectedRoomIds.clear(); activeSpaceId = spaceId; activeFilter = ActiveFilter.spaces; + // #Pangea + // don't show all spaces view if in column mode + if (spaceId == null && FluffyThemes.isColumnMode(context)) { + activeFilter = ActiveFilter.allChats; + } + // Pangea# }); } @@ -693,7 +699,7 @@ class ChatListController extends State title: L10n.of(context)!.areYouSure, okLabel: L10n.of(context)!.yes, cancelLabel: L10n.of(context)!.cancel, - message: onlyAdmin + message: onlyAdmin && selectedRoomIds.length == 1 ? L10n.of(context)!.onlyAdminDescription : L10n.of(context)!.leaveRoomDescription, ) == diff --git a/lib/pages/chat_list/chat_list_header.dart b/lib/pages/chat_list/chat_list_header.dart index 12f2f6b44d..20f41ea083 100644 --- a/lib/pages/chat_list/chat_list_header.dart +++ b/lib/pages/chat_list/chat_list_header.dart @@ -171,6 +171,12 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget { onPressed: controller.toggleMuted, ), // #Pangea + if (controller.selectedRoomIds.length > 1) + IconButton( + icon: const Icon(Icons.arrow_forward), + tooltip: L10n.of(context)!.leave, + onPressed: controller.leaveAction, + ), if (controller.selectedRoomIds.length == 1 && !(Matrix.of(context) .client diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index 1fde5f0f8c..0757354c5d 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -147,7 +147,10 @@ class _SpaceViewState extends State { if (activeSpace != null) { await setChatCount( activeSpace, - _lastResponse[activeSpaceId], + _lastResponse[activeSpaceId] ?? + GetSpaceHierarchyResponse( + rooms: [], + ), ); } // Pangea#