diff --git a/component/template/src/action.rs b/component/template/src/action.rs index f422a62..71bd557 100644 --- a/component/template/src/action.rs +++ b/component/template/src/action.rs @@ -14,7 +14,7 @@ pub enum Action { Suspend, Resume, Quit, - Refresh, + ClearScreen, Error(String), Help, } diff --git a/component/template/src/app.rs b/component/template/src/app.rs index e528d05..afee6bc 100644 --- a/component/template/src/app.rs +++ b/component/template/src/app.rs @@ -105,6 +105,7 @@ impl App { Action::Quit => self.should_quit = true, Action::Suspend => self.should_suspend = true, Action::Resume => self.should_suspend = false, + Action::ClearScreen => tui.terminal.clear()?, Action::Resize(w, h) => { tui.resize(Rect::new(0, 0, w, h))?; tui.draw(|f| { @@ -137,7 +138,7 @@ impl App { if self.should_suspend { tui.suspend()?; action_tx.send(Action::Resume)?; - tui = tui::Tui::new()?.tick_rate(self.tick_rate).frame_rate(self.frame_rate); + action_tx.send(Action::ClearScreen)?; // tui.mouse(true); tui.enter()?; } else if self.should_quit {