Skip to content

Commit 1665ffe

Browse files
committed
fix: clean up event handling and drawing logic in the main loop
1 parent 1b5dfa5 commit 1665ffe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ui/app.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,18 @@ impl App {
9595
let event_result = {
9696
let event_handler = self.event_handler.clone();
9797
tokio::task::spawn_blocking(move || event_handler.next_event())
98-
}.await;
98+
}
99+
.await;
99100

100101
match event_result? {
101102
Ok(event) => {
102103
// Only handle events that aren't None
103104
if event != AppEvent::None {
104105
self.handle_event(event);
105-
106+
106107
// Only redraw after handling a real event
107108
terminal.draw(|f| self.draw(f))?;
108-
109+
109110
// Check if we should quit after handling the event
110111
if self.should_quit() {
111112
break;

0 commit comments

Comments
 (0)