buffer close, not kill implemented yet

This commit is contained in:
filipriec
2025-04-15 18:29:59 +02:00
parent 09068fd4e5
commit 5e482cd77b
5 changed files with 12 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ use crossterm::event::{Event, KeyCode};
use crate::config::binds::config::Config;
use crate::ui::handlers::context::DialogPurpose;
use crate::state::app::state::AppState;
use crate::state::app::buffer::{AppView, BufferState};
use crate::state::pages::auth::AuthState;
use crate::state::pages::auth::LoginState;
use crate::state::pages::auth::RegisterState;
@@ -20,6 +21,7 @@ pub async fn handle_dialog_event(
auth_state: &mut AuthState,
login_state: &mut LoginState,
register_state: &mut RegisterState,
buffer_state: &mut BufferState,
) -> Option<Result<EventOutcome, Box<dyn std::error::Error>>> {
if let Event::Key(key) = event {
// Always allow Esc to dismiss
@@ -62,7 +64,7 @@ pub async fn handle_dialog_event(
match selected_index {
0 => { // "Menu" button selected
app_state.hide_dialog();
let message = login::back_to_main(login_state, app_state).await;
let message = login::back_to_main(login_state, app_state, buffer_state).await;
return Some(Ok(EventOutcome::Ok(message)));
}
1 => {