Skip to content

Commit

Permalink
Update src/chat/chat_panel.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Franco Profeti <7684329+noxware@users.noreply.github.com>
  • Loading branch information
jmbejar and noxware authored Jul 8, 2024
1 parent 03e71e6 commit fe7652b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/chat/chat_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,11 +714,7 @@ impl ChatPanel {
fn reset_scroll_messages(&mut self, store: &Store) {
let list = self.portal_list(id!(chat));
let messages = get_chat_messages(store).unwrap();
let index = if messages.len() > 1 {
messages.len() - 1
} else {
0
};
let index = messages.len().saturating_sub(1);
list.set_first_id(index);
}

Expand Down

0 comments on commit fe7652b

Please sign in to comment.