Scrolling now fully works.

Infinite scrolling backwards no longer happens.

Closes #115
This commit is contained in:
Xithrius 2022-06-13 21:47:13 -07:00
parent 4f33bfb35c
commit 2e15c7b184
No known key found for this signature in database
GPG Key ID: 04B94D37B0B8C08F
2 changed files with 4 additions and 2 deletions

View File

@ -141,7 +141,7 @@ pub async fn ui_driver(
match app.state {
State::MessageInput | State::MessageSearch | State::Normal => match key {
Key::ScrollUp => {
if app.scroll_offset < usize::MAX {
if app.scroll_offset < app.messages.len() {
app.scroll_offset += 1;
}
}

View File

@ -85,7 +85,9 @@ pub fn draw_ui<T: Backend>(frame: &mut Frame<T>, app: &mut App, config: &Complet
if app.filters.contaminated(msg) {
continue;
}
} else if scroll_offset > 0 {
}
if scroll_offset > 0 {
scroll_offset -= 1;
continue;