| @@ -26,14 +26,16 @@ | ||
| 26 | 26 | }, []), |
| 27 | 27 | }; |
| 28 | 28 | }; |
| 29 | 29 | |
| 30 | -export const useThemeVariations = () => { | |
| 30 | +export const useThemeVariations = ({ enabled = true } = {}) => { | |
| 31 | 31 | const { data, error, isLoading } = useSWRImmutable( |
| 32 | - { | |
| 33 | - key: 'theme-variations', | |
| 34 | - themeSlug: window.extAgentData.context.themeSlug, | |
| 35 | - }, | |
| 32 | + enabled | |
| 33 | + ? { | |
| 34 | + key: 'theme-variations', | |
| 35 | + themeSlug: window.extAgentData.context.themeSlug, | |
| 36 | + } | |
| 37 | + : null, | |
| 36 | 38 | fetcher, |
| 37 | 39 | ); |
| 38 | 40 | return { variations: data?.variations, error, isLoading }; |
| 39 | 41 | }; |