fixing warnings
This commit is contained in:
@@ -118,7 +118,6 @@ impl EventHandler {
|
||||
&event,
|
||||
config,
|
||||
app_state,
|
||||
auth_state,
|
||||
login_state,
|
||||
register_state,
|
||||
buffer_state,
|
||||
@@ -184,17 +183,15 @@ impl EventHandler {
|
||||
}
|
||||
// --- Add Table Page Navigation ---
|
||||
if app_state.ui.show_add_table {
|
||||
if let Some(action) = config.get_general_action(key.code, key.modifiers) {
|
||||
if add_table_nav::handle_add_table_navigation(
|
||||
key,
|
||||
config,
|
||||
app_state,
|
||||
&mut admin_state.add_table_state,
|
||||
&mut self.command_message,
|
||||
if add_table_nav::handle_add_table_navigation(
|
||||
key,
|
||||
config,
|
||||
app_state,
|
||||
&mut admin_state.add_table_state,
|
||||
&mut self.command_message,
|
||||
|
||||
) {
|
||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||
}
|
||||
) {
|
||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,8 +210,7 @@ impl EventHandler {
|
||||
).await;
|
||||
match nav_outcome {
|
||||
Ok(EventOutcome::ButtonSelected { context, index }) => {
|
||||
let mut message = String::from("Selected");
|
||||
match context {
|
||||
let message = match context {
|
||||
UiContext::Intro => {
|
||||
intro::handle_intro_selection(app_state, buffer_state, index);
|
||||
if app_state.ui.show_admin {
|
||||
@@ -222,7 +218,7 @@ impl EventHandler {
|
||||
admin_state.profile_list_state.select(Some(0));
|
||||
}
|
||||
}
|
||||
message = format!("Intro Option {} selected", index);
|
||||
format!("Intro Option {} selected", index)
|
||||
}
|
||||
UiContext::Login => {
|
||||
let login_action_message = match index {
|
||||
@@ -239,23 +235,23 @@ impl EventHandler {
|
||||
1 => login::back_to_main(login_state, app_state, buffer_state).await,
|
||||
_ => "Invalid Login Option".to_string(),
|
||||
};
|
||||
message = login_action_message;
|
||||
login_action_message
|
||||
}
|
||||
UiContext::Register => {
|
||||
message = match index {
|
||||
match index {
|
||||
0 => register::save(register_state, &mut self.auth_client, app_state).await?,
|
||||
1 => register::back_to_login(register_state, app_state, buffer_state).await,
|
||||
_ => "Invalid Login Option".to_string(),
|
||||
};
|
||||
}
|
||||
}
|
||||
UiContext::Admin => {
|
||||
admin::handle_admin_selection(app_state, admin_state);
|
||||
message = format!("Admin Option {} selected", index);
|
||||
format!("Admin Option {} selected", index)
|
||||
}
|
||||
UiContext::Dialog => {
|
||||
message = "Internal error: Unexpected dialog state".to_string();
|
||||
"Internal error: Unexpected dialog state".to_string()
|
||||
}
|
||||
}
|
||||
}; // Semicolon added here
|
||||
return Ok(EventOutcome::Ok(message));
|
||||
}
|
||||
other => return other,
|
||||
|
||||
Reference in New Issue
Block a user