Commit 02c5605
Changed files (1)
src
src/main.rs
@@ -102,8 +102,10 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> Result<()>
terminal.draw(|f| ui(f, app))?;
- if let Event::Key(key) = event::read()? {
- match app.current_screen {
+ // Use poll instead of read to avoid blocking, allowing for regular UI updates
+ if event::poll(std::time::Duration::from_millis(100))? {
+ if let Event::Key(key) = event::read()? {
+ match app.current_screen {
CurrentScreen::FeedList => match key.code {
KeyCode::Char('q') => return Ok(()),
KeyCode::Char('j') | KeyCode::Down => app.next_feed(),
@@ -136,6 +138,7 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> Result<()>
_ => {}
},
}
+ }
}
}
}