fixed and now fully functional
This commit is contained in:
@@ -4,6 +4,7 @@ use crossterm::event::{KeyEvent, KeyCode, KeyModifiers};
|
||||
use crate::config::binds::config::Config;
|
||||
use crate::services::grpc_client::GrpcClient;
|
||||
use crate::state::pages::form::FormState;
|
||||
use crate::state::{state::AppState, pages::auth::AuthState};
|
||||
use crate::modes::common::commands::CommandHandler;
|
||||
use crate::tui::terminal::core::TerminalCore;
|
||||
use crate::tui::functions::common::form::{save, revert};
|
||||
@@ -14,6 +15,8 @@ use std::error::Error;
|
||||
pub async fn handle_command_event(
|
||||
key: KeyEvent,
|
||||
config: &Config,
|
||||
app_state: &AppState,
|
||||
auth_state: &AuthState,
|
||||
form_state: &mut FormState,
|
||||
command_input: &mut String,
|
||||
command_message: &mut String,
|
||||
@@ -35,6 +38,8 @@ pub async fn handle_command_event(
|
||||
return process_command(
|
||||
config,
|
||||
form_state,
|
||||
app_state,
|
||||
auth_state,
|
||||
command_input,
|
||||
command_message,
|
||||
grpc_client,
|
||||
@@ -67,6 +72,8 @@ pub async fn handle_command_event(
|
||||
async fn process_command(
|
||||
config: &Config,
|
||||
form_state: &mut FormState,
|
||||
app_state: &AppState,
|
||||
auth_state: &AuthState,
|
||||
command_input: &mut String,
|
||||
command_message: &mut String,
|
||||
grpc_client: &mut GrpcClient,
|
||||
@@ -89,7 +96,13 @@ async fn process_command(
|
||||
match action {
|
||||
"force_quit" | "save_and_quit" | "quit" => {
|
||||
let (should_exit, message) = command_handler
|
||||
.handle_command(action, terminal)
|
||||
.handle_command(
|
||||
action,
|
||||
terminal,
|
||||
app_state,
|
||||
form_state,
|
||||
auth_state,
|
||||
)
|
||||
.await?;
|
||||
command_input.clear();
|
||||
if should_exit {
|
||||
|
||||
@@ -268,6 +268,8 @@ impl EventHandler {
|
||||
let outcome = command_mode::handle_command_event(
|
||||
key,
|
||||
config,
|
||||
app_state,
|
||||
auth_state,
|
||||
form_state,
|
||||
&mut self.command_input,
|
||||
&mut self.command_message,
|
||||
|
||||
Reference in New Issue
Block a user