Skip to content

Commit

Permalink
fix: standard filter backup
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Jan 10, 2024
1 parent 32df5e9 commit 5a0cdf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/layout/dialogs/filters/Advanced.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export default function AdvancedFilter() {
const isMobile = useStatic((s) => s.isMobile)
const legacyFilter = useStore((s) => !!s.userSettings[category]?.legacyFilter)
const standard = useStatic((s) =>
category === 'pokemon' ? s.filters[category].standard : STANDARD_BACKUP,
category === 'pokemon'
? s.filters[category]?.standard || STANDARD_BACKUP
: STANDARD_BACKUP,
)
const [filters, setFilters] = useDeepStore(
`filters.${category}.filter.${id}`,
Expand Down
4 changes: 2 additions & 2 deletions src/services/filtering/applyToAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function applyToAll(
const userFilters = localFilters.filter ?? {}

const serverFilters = useStatic.getState().filters[category]
const staticFilters = serverFilters.filter ?? {}
const refFilter = serverFilters.standard ?? STANDARD_BACKUP
const staticFilters = serverFilters?.filter ?? {}
const refFilter = serverFilters?.standard ?? STANDARD_BACKUP

const idSet = new Set(selectedIds ?? [])

Expand Down

0 comments on commit 5a0cdf5

Please sign in to comment.