From 355297d977dd0effd8ceb3c8e8e7ea2476932454 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Thu, 8 Feb 2024 10:48:45 -0800 Subject: [PATCH] Oops, I missed a syntax error lol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I thought this refactor of this change was working, but actually it was just failing to build the JS lmao. Here's a version with correct syntax! 😅 Is there a syntax for this kind of thing that I'm just forgetting? Idk, oh well! --- app/javascript/wardrobe-2020/loaders/alt-styles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/wardrobe-2020/loaders/alt-styles.js b/app/javascript/wardrobe-2020/loaders/alt-styles.js index 49a1ae1f..a0f1dc0e 100644 --- a/app/javascript/wardrobe-2020/loaders/alt-styles.js +++ b/app/javascript/wardrobe-2020/loaders/alt-styles.js @@ -1,11 +1,11 @@ import { useQuery } from "@tanstack/react-query"; -export function useAltStylesForSpecies(speciesId, options = {enabled = true}) { +export function useAltStylesForSpecies(speciesId, options = {}) { return useQuery({ ...options, queryKey: ["altStylesForSpecies", String(speciesId)], queryFn: () => loadAltStylesForSpecies(speciesId), - enabled: options.enabled && speciesId != null, + enabled: (options.enabled ?? true) && speciesId != null, }); }