Skip to content

Commit

Permalink
show last state message when exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
zd4y committed Mar 27, 2024
1 parent 1cb9474 commit f7eb1d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ impl App {
self.handle_events().wrap_err("handling events failed")?;
}
self.sender.blocking_send(TuiMessage::Quit)?;
terminal.draw(|frame| frame.render_widget(Paragraph::new("exiting..."), frame.size()))?;
terminal.draw(|frame| {
frame.render_widget(
Paragraph::new(self.state_msg.as_deref().unwrap_or("exiting...")),
frame.size(),
)
})?;
// handle remaining messages before exiting
while let Some(msg) = self.receiver.blocking_recv() {
match msg {
Expand Down

0 comments on commit f7eb1d4

Please sign in to comment.