more fixes

This commit is contained in:
filipriec
2025-03-21 12:52:33 +01:00
parent 5edc286854
commit 1a55f9c066
5 changed files with 30 additions and 63 deletions

View File

@@ -7,7 +7,6 @@ use crate::config::key_sequences::KeySequenceTracker;
use crate::tui::terminal::{
core::TerminalCore,
grpc_client::GrpcClient,
commands::CommandHandler,
};
#[derive(PartialEq)]
@@ -24,7 +23,8 @@ pub async fn handle_read_only_event(
key_sequence_tracker: &mut KeySequenceTracker,
current_position: &mut u64,
total_count: u64,
app_terminal: &mut AppTerminal,
terminal: &mut TerminalCore,
grpc_client: &mut GrpcClient,
command_message: &mut String,
edit_mode_cooldown: &mut bool,
ideal_cursor_column: &mut usize,
@@ -62,7 +62,7 @@ pub async fn handle_read_only_event(
command_message,
current_position,
total_count,
app_terminal,
grpc_client,
).await?;
key_sequence_tracker.reset();
return Ok((false, result));
@@ -84,7 +84,7 @@ pub async fn handle_read_only_event(
command_message,
current_position,
total_count,
app_terminal,
grpc_client,
).await?;
key_sequence_tracker.reset();
return Ok((false, result));
@@ -103,7 +103,7 @@ pub async fn handle_read_only_event(
command_message,
current_position,
total_count,
app_terminal,
grpc_client,
).await?;
return Ok((false, result));
}
@@ -129,14 +129,14 @@ async fn execute_action(
command_message: &mut String,
current_position: &mut u64,
total_count: u64,
app_terminal: &mut AppTerminal,
grpc_client: &mut GrpcClient,
) -> Result<String, Box<dyn std::error::Error>> {
match action {
"previous_entry" => {
let new_position = current_position.saturating_sub(1);
if new_position >= 1 {
*current_position = new_position;
match app_terminal.get_adresar_by_position(*current_position).await {
match grpc_client.get_adresar_by_position(*current_position).await {
Ok(response) => {
form_state.id = response.id;
form_state.values = vec![
@@ -166,7 +166,7 @@ async fn execute_action(
if *current_position <= total_count {
*current_position += 1;
if *current_position <= total_count {
match app_terminal.get_adresar_by_position(*current_position).await {
match grpc_client.get_adresar_by_position(*current_position).await {
Ok(response) => {
form_state.id = response.id;
form_state.values = vec![