Archived chats don't show Chat Details or Leave

This commit is contained in:
Kelrap 2024-05-20 14:26:18 -04:00
parent 39c8012137
commit 5f83955544
3 changed files with 30 additions and 13 deletions

View file

@ -20,6 +20,7 @@ class ArchiveController extends State<Archive> {
Future<List<Room>> getArchive(BuildContext context) async {
if (archive.isNotEmpty) return archive;
// #Pangea
//return archive = await Matrix.of(context).client.loadArchive();
return archive = (await Matrix.of(context).client.loadArchive())
.where((e) => (!e.isSpace && !e.isAnalyticsRoom))
.toList();

View file

@ -116,7 +116,8 @@ class ChatView extends StatelessWidget {
// #Pangea
} else {
return [
ChatSettingsPopupMenu(controller.room, !controller.room.isDirectChat),
ChatSettingsPopupMenu(controller.room,
(!controller.room.isDirectChat && !controller.room.isArchived)),
];
}

View file

@ -83,19 +83,34 @@ class ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
],
),
),
PopupMenuItem<String>(
value: 'leave',
child: Row(
children: [
// #Pangea
// const Icon(Icons.delete_outlined),
const Icon(Icons.arrow_forward),
// Pangea#
const SizedBox(width: 12),
Text(L10n.of(context)!.leave),
],
// #Pangea
// PopupMenuItem<String>(
// value: 'leave',
// child: Row(
// children: [
// // #Pangea
// // const Icon(Icons.delete_outlined),
// const Icon(Icons.arrow_forward),
// // Pangea#
// const SizedBox(width: 12),
// Text(L10n.of(context)!.leave),
// ],
// ),
// ),
if (!widget.room.isArchived)
PopupMenuItem<String>(
value: 'leave',
child: Row(
children: [
// #Pangea
// const Icon(Icons.delete_outlined),
const Icon(Icons.arrow_forward),
// Pangea#
const SizedBox(width: 12),
Text(L10n.of(context)!.leave),
],
),
),
),
// #Pangea
if (classSettings != null)
PopupMenuItem<String>(