feat(ui): Look for Room in the ring buffer from the newest instead of the oldest

feat(ui): Look for `Room` in the ring buffer from the newest instead of the oldest
This commit is contained in:
Ivan Enderlin
2023-07-24 15:03:53 +02:00
committed by GitHub
@@ -313,7 +313,8 @@ impl RoomListService {
pub async fn room(&self, room_id: &RoomId) -> Result<Room, Error> {
{
let rooms = self.rooms.read().await;
if let Some(room) = rooms.iter().find(|room| room.id() == room_id) {
if let Some(room) = rooms.iter().rfind(|room| room.id() == room_id) {
return Ok(room.clone());
}
}