From 7cbe5ce8beaeadfa7c0d883de6ee5302a188030b Mon Sep 17 00:00:00 2001 From: filipriec Date: Mon, 14 Apr 2025 16:25:54 +0200 Subject: [PATCH] intro movement fixed --- client/src/state/pages/intro.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/client/src/state/pages/intro.rs b/client/src/state/pages/intro.rs index d71464c..5f859be 100644 --- a/client/src/state/pages/intro.rs +++ b/client/src/state/pages/intro.rs @@ -1,5 +1,4 @@ // src/state/pages/intro.rs -use ratatui::style::Modifier; #[derive(Default, Clone, Debug)] pub struct IntroState { @@ -12,15 +11,15 @@ impl IntroState { } pub fn next_option(&mut self) { - self.selected_option = (self.selected_option + 1) % 4; + if self.selected_option < 3 { + self.selected_option += 1; + } } pub fn previous_option(&mut self) { - self.selected_option = if self.selected_option == 0 { - 3 - } else { - self.selected_option - 1 - }; + if self.selected_option > 0 { + self.selected_option -= 1 + } } }