minor error fix

This commit is contained in:
filipriec
2025-04-07 22:55:07 +02:00
parent d7d7fd614b
commit fc04af148d

View File

@@ -4,6 +4,7 @@ use crate::config::binds::config::Config;
use crate::services::grpc_client::GrpcClient;
use crate::state::pages::{auth::AuthState, form::FormState};
use crate::functions::modes::edit::{auth_e, form_e};
use crate::modes::handlers::event::EventOutcome;
use crossterm::event::{KeyCode, KeyEvent};
pub async fn handle_edit_event(
@@ -36,7 +37,7 @@ pub async fn handle_edit_event(
key.modifiers
) {
if matches!(action, "save" | "revert") {
return if is_auth_context {
let message = if is_auth_context {
auth_e::execute_common_action(
action,
auth_state, // Concrete AuthState
@@ -52,7 +53,14 @@ pub async fn handle_edit_event(
current_position,
total_count
).await
};
.map(|outcome| match outcome {
EventOutcome::Ok(msg) => msg,
EventOutcome::Exit(msg) => format!("Exit requested: {}", msg), // Or handle differently
EventOutcome::DataSaved(save_outcome, msg) => format!("Data saved ({:?}): {}", save_outcome, msg),
// Add other EventOutcome variants if necessary
})
}?;
return Ok(message);
}
}