killing of the buffer now works amazingly well

This commit is contained in:
filipriec
2025-05-25 22:24:26 +02:00
parent d8f9372bbd
commit 32210a5f7c
7 changed files with 38 additions and 18 deletions

View File

@@ -121,10 +121,7 @@ impl EventHandler {
else if ui.show_admin { AppView::Admin }
else if ui.show_add_logic { AppView::AddLogic }
else if ui.show_add_table { AppView::AddTable }
else if ui.show_form {
let form_name = app_state.selected_profile.clone().unwrap_or_else(|| "Data Form".to_string());
AppView::Form(form_name)
}
else if ui.show_form { AppView::Form } // Remove the dynamic name part
else { AppView::Scratch }
};
buffer_state.update_history(current_view);
@@ -177,8 +174,14 @@ impl EventHandler {
return Ok(EventOutcome::Ok("Switched to previous buffer".to_string()));
}
}
//"close_buffer" => {
// let message = buffer_state.close_buffer_with_intro_fallback();
// return Ok(EventOutcome::Ok(message));
//}
"close_buffer" => {
let message = buffer_state.close_buffer_with_intro_fallback();
// TODO: Replace with actual table name from server response
let current_table_name = Some("2025_customer"); // Your hardcoded table name
let message = buffer_state.close_buffer_with_intro_fallback(current_table_name);
return Ok(EventOutcome::Ok(message));
}
_ => {}