Skip to content

Commit

Permalink
fix: onlyShowAvailable for nests selector
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Feb 11, 2024
1 parent 9a6fa72 commit 068dac2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion server/src/configs/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@
"polygons": false,
"pokemon": false,
"allPokemon": true,
"onlyShowAvailable": true,
"avgFilter": [
0,
100
Expand Down Expand Up @@ -1022,4 +1023,4 @@
"tracesSampleRate": 0.1
}
}
}
}
1 change: 1 addition & 0 deletions server/src/services/filters/builder/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function buildDefaultFilters(perms) {
perms.nests && Db.models.Nest
? {
enabled: defaultFilters.nests.enabled,
onlyShowAvailable: defaultFilters.nests.onlyShowAvailable,
pokemon: defaultFilters.nests.pokemon,
polygons: defaultFilters.nests.polygons,
avgFilter: defaultFilters.nests.avgFilter,
Expand Down
5 changes: 3 additions & 2 deletions src/components/layout/drawer/SelectorList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ function SelectorList({ category, subCategory, label, height = 400 }) {
const allFilters = useMemory((s) => s.filters[category]?.filter)

const onlyShowAvailable = useStorage((s) =>
category === 'pokemon' ? !!s.filters[category]?.onlyShowAvailable : true,
category === 'pokemon' || category === 'nests'
? !!s.filters[category]?.onlyShowAvailable
: true,
)
const easyMode = useStorage((s) => !!s.filters[category]?.easyMode)
const search = useStorage((s) => s.searches[searchKey] || '')
Expand Down Expand Up @@ -139,7 +141,6 @@ function SelectorList({ category, subCategory, label, height = 400 }) {
)}
{(category === 'pokemon' || category === 'nests') && (
<BoolToggle
// @ts-ignore // WHY TS??
field={`filters.${category}.onlyShowAvailable`}
label="only_show_available"
disableGutters={category === 'nests'}
Expand Down

0 comments on commit 068dac2

Please sign in to comment.