working dialog is now at the correct place
This commit is contained in:
@@ -123,18 +123,6 @@ impl AppState {
|
||||
}
|
||||
}
|
||||
|
||||
/// Shows a standard success dialog after saving a table.
|
||||
pub fn show_save_success_dialog(&mut self, message: &str) {
|
||||
self.ui.dialog.dialog_show = true;
|
||||
self.ui.dialog.dialog_title = "Save Successful".to_string();
|
||||
self.ui.dialog.dialog_message = message.to_string();
|
||||
self.ui.dialog.dialog_buttons = vec!["OK".to_string()];
|
||||
self.ui.dialog.dialog_active_button_index = 0;
|
||||
self.ui.dialog.purpose = Some(DialogPurpose::SaveTableSuccess);
|
||||
self.ui.dialog.is_loading = false;
|
||||
self.ui.focus_outside_canvas = true;
|
||||
self.focused_button_index = 0; // Focus the first (only) button
|
||||
}
|
||||
|
||||
/// Hides the dialog and clears its content.
|
||||
pub fn hide_dialog(&mut self) {
|
||||
|
||||
@@ -23,6 +23,7 @@ use crate::tui::functions::common::login::LoginResult;
|
||||
use crate::tui::functions::common::register::RegisterResult;
|
||||
use crate::tui::functions::common::add_table::handle_save_table_action;
|
||||
use crate::functions::modes::navigation::add_table_nav::SaveTableResultSender;
|
||||
use crate::ui::handlers::context::{DialogPurpose, UiContext};
|
||||
use crate::tui::functions::common::login;
|
||||
use crate::tui::functions::common::register;
|
||||
use std::time::Instant;
|
||||
@@ -230,7 +231,12 @@ pub async fn run_ui() -> Result<()> {
|
||||
app_state.hide_dialog(); // Hide loading indicator
|
||||
match result {
|
||||
Ok(ref success_message) => {
|
||||
app_state.show_save_success_dialog(success_message);
|
||||
app_state.show_dialog(
|
||||
"Save Successful",
|
||||
success_message,
|
||||
vec!["OK".to_string()],
|
||||
DialogPurpose::SaveTableSuccess,
|
||||
);
|
||||
admin_state.add_table_state.has_unsaved_changes = false;
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user