From efb59c5571dd0c2efa8639610c1e92994d8e56fc Mon Sep 17 00:00:00 2001 From: filipriec Date: Mon, 31 Mar 2025 15:12:50 +0200 Subject: [PATCH] split config in modes/canvas is fixed and working properly well --- client/src/modes/canvas/edit.rs | 9 ++++----- client/src/modes/common/command_mode.rs | 8 +++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/client/src/modes/canvas/edit.rs b/client/src/modes/canvas/edit.rs index b6ac1c0..bd270c7 100644 --- a/client/src/modes/canvas/edit.rs +++ b/client/src/modes/canvas/edit.rs @@ -4,9 +4,8 @@ use crossterm::event::{KeyEvent, KeyCode, KeyModifiers}; use crate::config::binds::config::Config; use crate::state::pages::form::FormState; -use crate::tui::functions::common::form::{save, revert}; use crate::services::grpc_client::GrpcClient; - +use crate::tui::functions::common::form::{save, revert}; pub async fn handle_edit_event_internal( key: KeyEvent, @@ -68,7 +67,7 @@ async fn execute_common_action( ) -> Result> { match action { "save" => { - common::save( + save( form_state, grpc_client, is_saved, @@ -77,7 +76,7 @@ async fn execute_common_action( ).await }, "revert" => { - common::revert( + revert( form_state, grpc_client, current_position, @@ -178,7 +177,7 @@ async fn execute_edit_action( ) -> Result> { match action { "save" => { - common::save( + save( form_state, grpc_client, // Changed from AppTerminal is_saved, diff --git a/client/src/modes/common/command_mode.rs b/client/src/modes/common/command_mode.rs index 58a9b83..1459e61 100644 --- a/client/src/modes/common/command_mode.rs +++ b/client/src/modes/common/command_mode.rs @@ -6,9 +6,7 @@ use crate::services::grpc_client::GrpcClient; use crate::state::pages::form::FormState; use crate::tui::functions::common::commands::CommandHandler; use crate::tui::terminal::core::TerminalCore; -use crate::modes::{ - canvas::{common}, -}; +use crate::tui::functions::common::form::{save, revert}; pub async fn handle_command_event( key: KeyEvent, @@ -97,7 +95,7 @@ async fn process_command( Ok((should_exit, message, true)) }, "save" => { - let message = common::save( + let message = save( form_state, grpc_client, &mut command_handler.is_saved, @@ -108,7 +106,7 @@ async fn process_command( return Ok((false, message, true)); }, "revert" => { - let message = common::revert( + let message = revert( form_state, grpc_client, current_position,