From b2fd44df498d4355752c89e44b09fd7c41c14137 Mon Sep 17 00:00:00 2001 From: filipriec Date: Sun, 23 Mar 2025 22:41:18 +0100 Subject: [PATCH] working select setting the form to true in state state.rs --- client/src/modes/general/navigation.rs | 8 +++----- client/src/state/state.rs | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/src/modes/general/navigation.rs b/client/src/modes/general/navigation.rs index 8051dc8..fa9d2e0 100644 --- a/client/src/modes/general/navigation.rs +++ b/client/src/modes/general/navigation.rs @@ -25,11 +25,9 @@ pub fn previous_option(app_state: &mut AppState) { } pub fn select(app_state: &mut AppState) { - if app_state.ui.show_intro { - app_state.ui.show_intro = false; - } else if app_state.ui.show_admin { - app_state.ui.show_admin = false; - } + app_state.ui.show_form = app_state.ui.intro_state.selected_option == 0; + app_state.ui.show_admin = app_state.ui.intro_state.selected_option == 1; + app_state.ui.show_intro = false; } pub fn toggle_sidebar(app_state: &mut AppState) { diff --git a/client/src/state/state.rs b/client/src/state/state.rs index 8645b6b..d6a0897 100644 --- a/client/src/state/state.rs +++ b/client/src/state/state.rs @@ -2,6 +2,7 @@ use std::env; use common::proto::multieko2::table_definition::ProfileTreeResponse; +use crate::components::IntroState; pub struct UiState { pub show_sidebar: bool, @@ -9,6 +10,7 @@ pub struct UiState { pub show_intro: bool, pub show_admin: bool, pub show_form: bool, + pub intro_state: IntroState, } pub struct GeneralState { @@ -66,6 +68,7 @@ impl Default for UiState { show_intro: true, show_admin: false, show_form: false, + intro_state: IntroState::new(), } } }