Change start or stop to support errors

This commit is contained in:
Dheepak Krishnamurthy 2020-07-30 15:48:46 -06:00
parent e71c59e8b3
commit ca1444865a
2 changed files with 44 additions and 41 deletions

View file

@ -56,7 +56,13 @@ fn main() -> Result<(), Box<dyn Error>> {
Key::Up | Key::Char('k') => app.previous(),
Key::Char('d') => app.task_done(),
Key::Char('x') => app.task_delete(),
Key::Char('s') => app.task_start_or_stop(),
Key::Char('s') => match app.task_start_or_stop() {
Ok(_) => (),
Err(e) => {
app.mode = AppMode::TaskError;
app.error = e;
}
},
Key::Char('u') => app.task_undo(),
Key::Char('e') => {
events.pause_event_loop(&mut terminal);