displaying data properly, fixing hardcoded backend to firma part one
This commit is contained in:
@@ -23,8 +23,6 @@ pub async fn handle_read_only_event(
|
||||
add_table_state: &mut AddTableState,
|
||||
add_logic_state: &mut AddLogicState,
|
||||
key_sequence_tracker: &mut KeySequenceTracker,
|
||||
current_position: &mut u64,
|
||||
total_count: u64,
|
||||
grpc_client: &mut GrpcClient,
|
||||
command_message: &mut String,
|
||||
edit_mode_cooldown: &mut bool,
|
||||
@@ -74,12 +72,10 @@ pub async fn handle_read_only_event(
|
||||
action,
|
||||
form_state,
|
||||
grpc_client,
|
||||
current_position,
|
||||
total_count,
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
} else if app_state.ui.show_login && CONTEXT_ACTIONS_LOGIN.contains(&action) { // Handle login context actions
|
||||
} else if app_state.ui.show_login && CONTEXT_ACTIONS_LOGIN.contains(&action) {
|
||||
crate::tui::functions::login::handle_action(action).await?
|
||||
} else if app_state.ui.show_add_table {
|
||||
add_table_ro::execute_action(
|
||||
@@ -143,12 +139,10 @@ pub async fn handle_read_only_event(
|
||||
action,
|
||||
form_state,
|
||||
grpc_client,
|
||||
current_position,
|
||||
total_count,
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
} else if app_state.ui.show_login && CONTEXT_ACTIONS_LOGIN.contains(&action) { // Handle login context actions
|
||||
} else if app_state.ui.show_login && CONTEXT_ACTIONS_LOGIN.contains(&action) {
|
||||
crate::tui::functions::login::handle_action(action).await?
|
||||
} else if app_state.ui.show_add_table {
|
||||
add_table_ro::execute_action(
|
||||
@@ -177,7 +171,7 @@ pub async fn handle_read_only_event(
|
||||
key_sequence_tracker,
|
||||
command_message,
|
||||
).await?
|
||||
} else if app_state.ui.show_login { // Handle login general actions
|
||||
} else if app_state.ui.show_login {
|
||||
auth_ro::execute_action(
|
||||
action,
|
||||
app_state,
|
||||
@@ -211,8 +205,6 @@ pub async fn handle_read_only_event(
|
||||
action,
|
||||
form_state,
|
||||
grpc_client,
|
||||
current_position,
|
||||
total_count,
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
@@ -245,7 +237,7 @@ pub async fn handle_read_only_event(
|
||||
key_sequence_tracker,
|
||||
command_message,
|
||||
).await?
|
||||
} else if app_state.ui.show_login { // Handle login general actions
|
||||
} else if app_state.ui.show_login {
|
||||
auth_ro::execute_action(
|
||||
action,
|
||||
app_state,
|
||||
|
||||
@@ -338,15 +338,23 @@ impl EventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
let mut current_position = form_state.current_position;
|
||||
let total_count = form_state.total_count;
|
||||
let (_should_exit, message) = read_only::handle_read_only_event(
|
||||
app_state, key_event, config, form_state, login_state, register_state,
|
||||
&mut admin_state.add_table_state, &mut admin_state.add_logic_state,
|
||||
&mut self.key_sequence_tracker, &mut current_position, total_count,
|
||||
grpc_client, &mut self.command_message, &mut self.edit_mode_cooldown,
|
||||
app_state,
|
||||
key_event,
|
||||
config,
|
||||
form_state,
|
||||
login_state,
|
||||
register_state,
|
||||
&mut admin_state.add_table_state,
|
||||
&mut admin_state.add_logic_state,
|
||||
&mut self.key_sequence_tracker,
|
||||
// No more current_position or total_count arguments
|
||||
grpc_client,
|
||||
&mut self.command_message,
|
||||
&mut self.edit_mode_cooldown,
|
||||
&mut self.ideal_cursor_column,
|
||||
).await?;
|
||||
)
|
||||
.await?;
|
||||
return Ok(EventOutcome::Ok(message));
|
||||
}
|
||||
|
||||
@@ -365,15 +373,22 @@ impl EventHandler {
|
||||
return Ok(EventOutcome::Ok("".to_string()));
|
||||
}
|
||||
|
||||
let mut current_position = form_state.current_position;
|
||||
let total_count = form_state.total_count;
|
||||
let (_should_exit, message) = read_only::handle_read_only_event(
|
||||
app_state, key_event, config, form_state, login_state, register_state,
|
||||
&mut admin_state.add_table_state, &mut admin_state.add_logic_state,
|
||||
&mut self.key_sequence_tracker, &mut current_position, total_count,
|
||||
grpc_client, &mut self.command_message, &mut self.edit_mode_cooldown,
|
||||
app_state,
|
||||
key_event,
|
||||
config,
|
||||
form_state,
|
||||
login_state,
|
||||
register_state,
|
||||
&mut admin_state.add_table_state,
|
||||
&mut admin_state.add_logic_state,
|
||||
&mut self.key_sequence_tracker,
|
||||
grpc_client,
|
||||
&mut self.command_message,
|
||||
&mut self.edit_mode_cooldown,
|
||||
&mut self.ideal_cursor_column,
|
||||
).await?;
|
||||
)
|
||||
.await?;
|
||||
return Ok(EventOutcome::Ok(message));
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@ pub async fn handle_highlight_event(
|
||||
&mut admin_state.add_table_state,
|
||||
&mut admin_state.add_logic_state,
|
||||
key_sequence_tracker,
|
||||
current_position,
|
||||
total_count,
|
||||
grpc_client,
|
||||
command_message, // Pass the message buffer
|
||||
edit_mode_cooldown,
|
||||
|
||||
Reference in New Issue
Block a user