Skip to content

Commit

Permalink
Merge pull request #309 from pangeachat/small-ui-fixes
Browse files Browse the repository at this point in the history
allow leaving for all selected chats
  • Loading branch information
ggurdin authored Jun 7, 2024
2 parents 05ac1d7 + 363a91a commit f0424d5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/pages/chat_list/chat_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ class ChatListController extends State<ChatList>
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#
});
}

Expand Down Expand Up @@ -693,7 +699,7 @@ class ChatListController extends State<ChatList>
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,
) ==
Expand Down
6 changes: 6 additions & 0 deletions lib/pages/chat_list/chat_list_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion lib/pages/chat_list/space_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ class _SpaceViewState extends State<SpaceView> {
if (activeSpace != null) {
await setChatCount(
activeSpace,
_lastResponse[activeSpaceId],
_lastResponse[activeSpaceId] ??
GetSpaceHierarchyResponse(
rooms: [],
),
);
}
// Pangea#
Expand Down

0 comments on commit f0424d5

Please sign in to comment.