added color coding, new state, improved save logic
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -82,8 +82,11 @@ fn runApp<B: Backend>(app: &mut AppState, terminal: &mut Terminal<B>) -> Result<
|
||||
app.screen = CurrentScreen::Exit
|
||||
}
|
||||
KeyCode::Char('s') => {
|
||||
app.save();
|
||||
app.appStatus = AppStatus::Saved;
|
||||
if app.isHashDifferent() {
|
||||
app.saveConfigToScript();
|
||||
app.saveConfigToSettingsFile();
|
||||
app.appStatus = AppStatus::Saved;
|
||||
}
|
||||
}
|
||||
KeyCode::F(2) => app.screen = CurrentScreen::Settings,
|
||||
KeyCode::Char('d') => app.screen = CurrentScreen::Delete,
|
||||
@@ -181,8 +184,8 @@ fn runApp<B: Backend>(app: &mut AppState, terminal: &mut Terminal<B>) -> Result<
|
||||
},
|
||||
CurrentScreen::Exit => match key.code {
|
||||
KeyCode::Enter => {
|
||||
app.save();
|
||||
app.writeToConfig();
|
||||
app.saveConfigToSettingsFile();
|
||||
app.saveConfigToScript();
|
||||
return Ok(true);
|
||||
}
|
||||
KeyCode::Esc | KeyCode::Char('m') => app.screen = CurrentScreen::Main,
|
||||
|
||||
Reference in New Issue
Block a user