Skip to content

Commit

Permalink
fix: defaults in query button
Browse files Browse the repository at this point in the history
  • Loading branch information
akarras committed Oct 16, 2023
1 parent 41fe327 commit 0602db3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions ultros-frontend/ultros-app/src/components/query_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! { <a class=move || if is_active() { active_classes.get() } else { class.get() }.to_string() href=move || {
Expand Down
4 changes: 2 additions & 2 deletions ultros-frontend/ultros-app/src/routes/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use xiv_gen::ItemId;
use crate::{
api::{get_cheapest_listings, get_recent_sales_for_world},
components::{
ad::Ad, clipboard::*, gil::*, item_icon::*, meta::*, tooltip::*, virtual_scroller::*,
world_picker::*, query_button::QueryButton,
ad::Ad, clipboard::*, gil::*, item_icon::*, meta::*, query_button::QueryButton, tooltip::*,
virtual_scroller::*, world_picker::*,
},
error::AppError,
global_state::LocalWorldData,
Expand Down

0 comments on commit 0602db3

Please sign in to comment.