minor error fix
This commit is contained in:
@@ -4,6 +4,7 @@ use crate::config::binds::config::Config;
|
|||||||
use crate::services::grpc_client::GrpcClient;
|
use crate::services::grpc_client::GrpcClient;
|
||||||
use crate::state::pages::{auth::AuthState, form::FormState};
|
use crate::state::pages::{auth::AuthState, form::FormState};
|
||||||
use crate::functions::modes::edit::{auth_e, form_e};
|
use crate::functions::modes::edit::{auth_e, form_e};
|
||||||
|
use crate::modes::handlers::event::EventOutcome;
|
||||||
use crossterm::event::{KeyCode, KeyEvent};
|
use crossterm::event::{KeyCode, KeyEvent};
|
||||||
|
|
||||||
pub async fn handle_edit_event(
|
pub async fn handle_edit_event(
|
||||||
@@ -36,7 +37,7 @@ pub async fn handle_edit_event(
|
|||||||
key.modifiers
|
key.modifiers
|
||||||
) {
|
) {
|
||||||
if matches!(action, "save" | "revert") {
|
if matches!(action, "save" | "revert") {
|
||||||
return if is_auth_context {
|
let message = if is_auth_context {
|
||||||
auth_e::execute_common_action(
|
auth_e::execute_common_action(
|
||||||
action,
|
action,
|
||||||
auth_state, // Concrete AuthState
|
auth_state, // Concrete AuthState
|
||||||
@@ -52,7 +53,14 @@ pub async fn handle_edit_event(
|
|||||||
current_position,
|
current_position,
|
||||||
total_count
|
total_count
|
||||||
).await
|
).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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user