buffer logic going hard, we are killing buffers from login and register now
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
// src/tui/functions/common/register.rs
|
||||
|
||||
use crate::{
|
||||
services::auth::AuthClient,
|
||||
state::{
|
||||
pages::auth::RegisterState,
|
||||
app::state::AppState,
|
||||
pages::canvas_state::CanvasState,
|
||||
},
|
||||
ui::handlers::context::DialogPurpose,
|
||||
use crate::services::auth::AuthClient;
|
||||
use crate::state::{
|
||||
pages::auth::RegisterState,
|
||||
app::state::AppState,
|
||||
pages::canvas_state::CanvasState,
|
||||
};
|
||||
use crate::ui::handlers::context::DialogPurpose;
|
||||
use crate::state::app::buffer::{AppView, BufferState};
|
||||
|
||||
/// Attempts to register the user using the provided details via gRPC.
|
||||
/// Updates RegisterState and AppState on success or failure.
|
||||
@@ -131,9 +130,10 @@ pub async fn revert(
|
||||
}
|
||||
|
||||
/// Clears the form and returns to the intro screen.
|
||||
pub async fn back_to_main(
|
||||
pub async fn back_to_login(
|
||||
register_state: &mut RegisterState,
|
||||
app_state: &mut AppState,
|
||||
buffer_state: &mut BufferState,
|
||||
) -> String {
|
||||
// Clear fields first
|
||||
let _ = revert(register_state, app_state).await;
|
||||
@@ -142,8 +142,8 @@ pub async fn back_to_main(
|
||||
app_state.hide_dialog();
|
||||
|
||||
// Navigation logic
|
||||
app_state.ui.show_register = false;
|
||||
app_state.ui.show_intro = true;
|
||||
buffer_state.close_active_buffer();
|
||||
buffer_state.update_history(AppView::Login);
|
||||
|
||||
// Reset focus state
|
||||
app_state.ui.focus_outside_canvas = false;
|
||||
|
||||
Reference in New Issue
Block a user