From f9d30e88ce77153f7adbbbcaa66ddcdf02bf51cc Mon Sep 17 00:00:00 2001 From: euzu Date: Tue, 4 Nov 2025 23:52:55 +0100 Subject: [PATCH] some little fixes for webui --- frontend/src/app/components/config/macros.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/components/config/macros.rs b/frontend/src/app/components/config/macros.rs index 35b82f08d..e1bf91a75 100644 --- a/frontend/src/app/components/config/macros.rs +++ b/frontend/src/app/components/config/macros.rs @@ -307,7 +307,7 @@ macro_rules! edit_field_number_u64 { <$crate::app::components::number_input::NumberInput label={$label} name={stringify!($field)} - value={instance.form.$field as i64} + value={instance.form.$field.min(i64::MAX as u64) as i64} on_change={Callback::from(move |value: Option| { match value { Some(value) => match u64::try_from(value) { @@ -335,9 +335,9 @@ macro_rules! edit_field_number_option { value={instance.form.$field.map(|v| v as i64)} on_change={Callback::from(move |value: Option| { match value { - Some(value) => { - let val = u32::try_from(value).ok(); - instance.dispatch($action(val)) + Some(value) => match u32::try_from(value) { + Ok(val) => instance.dispatch($action(Some(val))), + Err(_) => return, }, None => instance.dispatch($action(None)), }