From 722c63af5412a8e4cc231be0af38af6bdc59ad27 Mon Sep 17 00:00:00 2001 From: filipriec Date: Wed, 26 Mar 2025 00:46:59 +0100 Subject: [PATCH] fixed the navigation previous function, therefore we are now moving into the login properly, lets implement the auth now --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- client/src/modes/general/navigation.rs | 11 +++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6c356f5..c964c11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -421,7 +421,7 @@ dependencies = [ [[package]] name = "client" -version = "0.2.0" +version = "0.2.5" dependencies = [ "common", "crossterm", @@ -457,7 +457,7 @@ dependencies = [ [[package]] name = "common" -version = "0.2.0" +version = "0.2.5" dependencies = [ "prost", "serde", @@ -2588,7 +2588,7 @@ dependencies = [ [[package]] name = "server" -version = "0.2.0" +version = "0.2.5" dependencies = [ "bcrypt", "chrono", diff --git a/Cargo.toml b/Cargo.toml index c122009..65c52ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ resolver = "2" [workspace.package] # TODO: idk how to do the name, fix later # name = "Multieko2" -version = "0.2.0" +version = "0.2.5" edition = "2021" license = "GPL-3.0-or-later" authors = ["Filip Priečinský "] diff --git a/client/src/modes/general/navigation.rs b/client/src/modes/general/navigation.rs index 14888bb..8183d31 100644 --- a/client/src/modes/general/navigation.rs +++ b/client/src/modes/general/navigation.rs @@ -108,13 +108,12 @@ pub fn previous_option(app_state: &mut AppState) { if app_state.ui.show_intro { app_state.ui.intro_state.previous_option(); } else { - // For other screens that might have options - if app_state.general.current_option == 0 { - // We'd need the option count here, but since it's not passed we can't wrap around correctly - // For now, just stay at 0 + let option_count = app_state.profile_tree.profiles.len(); + app_state.general.current_option = if app_state.general.current_option == 0 { + option_count.saturating_sub(1) // Wrap to last option } else { - app_state.general.current_option -= 1; - } + app_state.general.current_option - 1 + }; } }