From c97232470571bee5b16550dc596019656656f3a6 Mon Sep 17 00:00:00 2001 From: spinline Date: Wed, 4 Feb 2026 17:31:55 +0300 Subject: [PATCH] fix(ui): use approximate comparison for speed limit active state --- frontend/src/components/layout/statusbar.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/layout/statusbar.rs b/frontend/src/components/layout/statusbar.rs index a63175f..bc9dd93 100644 --- a/frontend/src/components/layout/statusbar.rs +++ b/frontend/src/components/layout/statusbar.rs @@ -32,7 +32,7 @@ pub fn StatusBar() -> impl IntoView { let (up_menu_open, set_up_menu_open) = create_signal(false); // Preset limits in bytes/s - let limits = vec![ + let limits: Vec<(i64, &str)> = vec![ (0, "Unlimited"), (100 * 1024, "100 KB/s"), (500 * 1024, "500 KB/s"), @@ -127,7 +127,7 @@ pub fn StatusBar() -> impl IntoView { limits.clone().into_iter().map(|(val, label)| { let is_active = move || { let current = stats.get().down_limit.unwrap_or(0); - current == val + (current - val).abs() < 1024 }; view! {
  • @@ -180,7 +180,7 @@ pub fn StatusBar() -> impl IntoView { limits.clone().into_iter().map(|(val, label)| { let is_active = move || { let current = stats.get().up_limit.unwrap_or(0); - current == val + (current - val).abs() < 1024 }; view! {