fix: Make sure that you deselect rooms on leaving, even if that fails

This commit is contained in:
Sorunome 2021-08-29 13:21:18 +02:00
parent 161791a07d
commit b0ecc408b5
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
1 changed files with 5 additions and 2 deletions

View File

@ -327,8 +327,11 @@ class ChatListController extends State<ChatList> {
final client = Matrix.of(context).client;
while (selectedRoomIds.isNotEmpty) {
final roomId = selectedRoomIds.first;
await client.getRoomById(roomId).leave();
toggleSelection(roomId);
try {
await client.getRoomById(roomId).leave();
} finally {
toggleSelection(roomId);
}
}
}