chore: remove archived room on forget (#2)

Co-authored-by: Clemens Toegel <clemens.toegel@x-tention.at>
This commit is contained in:
Clemens-Toegel 2023-10-20 09:50:01 +02:00 committed by The one with the braid
parent 0ec6a64cc8
commit f1fd6f43f9
1 changed files with 6 additions and 0 deletions

View File

@ -1187,6 +1187,12 @@ class Room {
Future<void> forget() async {
await client.database?.forgetRoom(id);
await client.forgetRoom(id);
// Update archived rooms, otherwise an archived room may still be in the
// list after a forget room call
final roomIndex = client.archivedRooms.indexWhere((r) => r.room.id == id);
if(roomIndex != -1){
client.archivedRooms.removeAt(roomIndex);
}
return;
}