diff --git a/lib/pages/archive/archive.dart b/lib/pages/archive/archive.dart index 06d80b7df..78e735d05 100644 --- a/lib/pages/archive/archive.dart +++ b/lib/pages/archive/archive.dart @@ -20,6 +20,7 @@ class ArchiveController extends State { Future> 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(); diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index 57255ffc9..21789f527 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -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)), ]; } diff --git a/lib/widgets/chat_settings_popup_menu.dart b/lib/widgets/chat_settings_popup_menu.dart index f10f08ff7..1feadc459 100644 --- a/lib/widgets/chat_settings_popup_menu.dart +++ b/lib/widgets/chat_settings_popup_menu.dart @@ -83,19 +83,34 @@ class ChatSettingsPopupMenuState extends State { ], ), ), - PopupMenuItem( - 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( + // 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( + 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(