added color coding, new state, improved save logic
Some checks failed
/ Quality Check (push) Failing after 1m33s
/ Build (push) Successful in 1m14s

This commit is contained in:
Phani Pavan K
2025-10-23 15:57:27 +05:30
parent a795ad986b
commit c4feab2f75
8 changed files with 89 additions and 17 deletions

View File

@@ -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,