diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index e7de171f7..08eabe6fd 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -587,11 +587,20 @@ class ChatListController extends State ) == OkCancelResult.ok; if (!confirmed) return; + // #Pangea + final bool archivedActiveRoom = + selectedRoomIds.contains(Matrix.of(context).activeRoomId); + // Pangea# await showFutureLoadingDialog( context: context, future: () => _archiveSelectedRooms(), ); setState(() {}); + // #Pangea + if (archivedActiveRoom) { + VRouter.of(context).to('/rooms'); + } + // Pangea# } void setStatus() async { diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index 15f5f06e2..fdd6b2954 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -162,7 +162,15 @@ class _SpaceViewState extends State { case SpaceChildContextAction.leave: await showFutureLoadingDialog( context: context, - future: room!.leave, + // #Pangea + // future: room!.leave, + future: () async { + await room!.leave(); + if (Matrix.of(context).activeRoomId == room.id) { + VRouter.of(context).to('/rooms'); + } + }, + // Pangea# ); break; case SpaceChildContextAction.removeFromSpace: