gRPC implementation of a registration working
This commit is contained in:
@@ -13,7 +13,7 @@ use crate::state::canvas_state::CanvasState;
|
||||
use crate::ui::handlers::rat_state::UiStateHandler;
|
||||
use crate::ui::handlers::context::UiContext;
|
||||
use crate::tui::functions::{intro, admin};
|
||||
use crate::tui::functions::common::login;
|
||||
use crate::tui::functions::common::{login, register};
|
||||
use crate::modes::{
|
||||
common::command_mode,
|
||||
canvas::{edit, read_only, common_mode},
|
||||
@@ -76,7 +76,7 @@ impl EventHandler {
|
||||
// --- DIALOG MODALITY ---
|
||||
if app_state.ui.dialog.dialog_show {
|
||||
if let Some(dialog_result) = dialog::handle_dialog_event(
|
||||
&event, config, app_state, auth_state, &mut self.auth_client
|
||||
&event, config, app_state, auth_state, register_state, &mut self.auth_client
|
||||
).await {
|
||||
return dialog_result;
|
||||
}
|
||||
@@ -122,6 +122,13 @@ impl EventHandler {
|
||||
_ => "Invalid Login Option".to_string(),
|
||||
};
|
||||
}
|
||||
UiContext::Register => {
|
||||
message = match index {
|
||||
0 => register::save(register_state, &mut self.auth_client, app_state).await?,
|
||||
1 => register::back_to_main(register_state, app_state).await,
|
||||
_ => "Invalid Login Option".to_string(),
|
||||
};
|
||||
}
|
||||
UiContext::Admin => {
|
||||
// Assuming handle_admin_selection uses app_state.general.selected_item
|
||||
admin::handle_admin_selection(app_state);
|
||||
|
||||
Reference in New Issue
Block a user