chore: remove archived room on forget (#2)
Co-authored-by: Clemens Toegel <clemens.toegel@x-tention.at>
This commit is contained in:
parent
0ec6a64cc8
commit
f1fd6f43f9
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue