dialog login functionality

This commit is contained in:
filipriec
2025-04-10 15:36:43 +02:00
parent 3ed8764087
commit 6b241304fb
5 changed files with 39 additions and 25 deletions

View File

@@ -3,8 +3,7 @@ use crate::services::auth::AuthClient;
use crate::state::pages::auth::AuthState;
use crate::state::state::AppState;
use crate::state::canvas_state::CanvasState;
// Remove unused import if CanvasState is not directly used here
// use crate::state::canvas_state::CanvasState;
use crate::ui::handlers::context::DialogPurpose;
/// Attempts to log the user in using the provided credentials via gRPC.
/// Updates AuthState and AppState on success or failure.
@@ -51,6 +50,7 @@ pub async fn save(
"Login Success",
&success_message,
vec!["Menu".to_string(), "Exit".to_string()],
DialogPurpose::LoginSuccess,
);
Ok("Login successful, details shown in dialog.".to_string())
@@ -62,7 +62,8 @@ pub async fn save(
app_state.show_dialog(
"Login Failed",
&error_message,
vec!["OK".to_string()], // Pass buttons here
vec!["OK".to_string()],
DialogPurpose::LoginFailed,
);
// REMOVE these lines:
// app_state.ui.dialog.dialog_title = "Login Failed".to_string();