switcher, have bugs

This commit is contained in:
filipriec
2025-03-31 15:42:48 +02:00
parent efb59c5571
commit 3ccf71ed0f
3 changed files with 65 additions and 25 deletions

View File

@@ -1,6 +1,8 @@
// src/tui/functions/common.rs
pub mod commands;
pub mod form;
pub mod login;
pub use commands::*;
pub use form::*;
pub use login::*;

View File

@@ -0,0 +1,21 @@
// src/tui/functions/common/login.rs
use crate::state::pages::auth::AuthState;
use crate::services::grpc_client::GrpcClient;
/// Shared logic for login operations
pub async fn save(
auth_state: &mut AuthState,
grpc_client: &mut GrpcClient,
) -> Result<String, Box<dyn std::error::Error>> {
// Implement your login-specific save logic here
Ok("Login credentials saved".to_string())
}
/// Shared logic for login cancellation
pub async fn cancel(
auth_state: &mut AuthState,
) -> String {
auth_state.clear_fields();
"Login cancelled".to_string()
}