Redirect to rooms when archiving or leaving active room

pull/795/head
ggurdin 2 years ago
parent 4b8fe976f1
commit f58bc1d67d

@ -587,11 +587,20 @@ class ChatListController extends State<ChatList>
) ==
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 {

@ -162,7 +162,15 @@ class _SpaceViewState extends State<SpaceView> {
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:

Loading…
Cancel
Save