diff --git a/app/javascript/wardrobe-2020/loaders/alt-styles.js b/app/javascript/wardrobe-2020/loaders/alt-styles.js index 86dbca08..49a1ae1f 100644 --- a/app/javascript/wardrobe-2020/loaders/alt-styles.js +++ b/app/javascript/wardrobe-2020/loaders/alt-styles.js @@ -1,10 +1,11 @@ import { useQuery } from "@tanstack/react-query"; -export function useAltStylesForSpecies(speciesId, options = {}) { +export function useAltStylesForSpecies(speciesId, options = {enabled = true}) { return useQuery({ ...options, queryKey: ["altStylesForSpecies", String(speciesId)], queryFn: () => loadAltStylesForSpecies(speciesId), + enabled: options.enabled && speciesId != null, }); }