Skip to content

Commit

Permalink
RoomsList: ensure the count of loaded rooms is always correct
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinaboos committed Dec 17, 2024
1 parent 6b84169 commit 378cdce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/home/rooms_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ impl Widget for RoomsList {
self.displayed_rooms.push(room_id);
}
}
self.update_status_rooms_count();
}
RoomsListUpdate::UpdateRoomAvatar { room_id, avatar } => {
if let Some(room) = self.all_rooms.get_mut(&room_id) {
Expand Down Expand Up @@ -313,6 +314,8 @@ impl Widget for RoomsList {
error!("Error: couldn't find room {room_id} to remove room");
});

self.update_status_rooms_count();

// TODO: send an action to the RoomScreen to hide this room
// if it is currently being displayed,
// and also ensure that the room's TimelineUIState is preserved
Expand All @@ -324,6 +327,7 @@ impl Widget for RoomsList {
RoomsListUpdate::ClearRooms => {
self.all_rooms.clear();
self.displayed_rooms.clear();
self.update_status_rooms_count();
}
RoomsListUpdate::NotLoaded => {
self.status = "Loading rooms (waiting for homeserver)...".to_string();
Expand Down

0 comments on commit 378cdce

Please sign in to comment.