From 0602db37a20f67f7f8c87c64bc2b358743624f8a Mon Sep 17 00:00:00 2001 From: akarras Date: Sun, 15 Oct 2023 23:25:13 -0600 Subject: [PATCH] fix: defaults in query button --- ultros-frontend/ultros-app/src/components/query_button.rs | 7 ++----- ultros-frontend/ultros-app/src/routes/analyzer.rs | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ultros-frontend/ultros-app/src/components/query_button.rs b/ultros-frontend/ultros-app/src/components/query_button.rs index b66c2ca5..4bf6e7c7 100644 --- a/ultros-frontend/ultros-app/src/components/query_button.rs +++ b/ultros-frontend/ultros-app/src/components/query_button.rs @@ -27,11 +27,8 @@ pub fn QueryButton( let query_name = query_1.get(); let value = value_1.get(); query.with(|q| { - q.get(&query_name) - .as_ref() - .map(|s| s.as_str()) - .unwrap_or_default() - == &value + let query_val = q.get(&query_name).as_ref().map(|s| s.as_str()); + query_val.unwrap_or_default() == &value || (default == true && query_val.is_none()) }) }; view! {