Skip to content

Commit

Permalink
fix: fallback state
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Feb 5, 2024
1 parent 2e03c50 commit 5ea5d15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useGetAvailable.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export default function useGetAvailable(category) {
}, [data])

return useMemo(() => {
const available = (data || previousData)?.[`available${capitalized}`] || []
const available =
(data || previousData)?.[`available${capitalized}`] ||
useMemory.getState().available[category] ||
[]
return { available, loading, error }
}, [data, previousData, loading, error])
}

0 comments on commit 5ea5d15

Please sign in to comment.