diff --git a/source/components/localisation/useLocalisation.ts b/source/components/localisation/useLocalisation.ts index c15b047697..cd9904dccd 100644 --- a/source/components/localisation/useLocalisation.ts +++ b/source/components/localisation/useLocalisation.ts @@ -13,16 +13,19 @@ const API = '/.netlify/functions/geolocation' export default () => { const dispatch = useDispatch() const localisation = useSelector((state: AppState) => state.localisation) - const iframeLocalisationOption = useSelector( + const iframeLocalisationOption: string | undefined = useSelector( (state: AppState) => state?.iframeOptions?.iframeLocalisation ) + console.log(iframeLocalisationOption) + const currentLang = useSelector( (state: AppState) => state.currentLang ).toLowerCase() - const iframeRegionParams: Region | undefined = - iframeLocalisationOption && useSupportedRegion(iframeLocalisationOption) + const iframeRegionParams: Region | undefined = useSupportedRegion( + iframeLocalisationOption + ) console.log(iframeRegionParams) useEffect(() => { diff --git a/source/components/localisation/utils.ts b/source/components/localisation/utils.ts index d6a39bcaf0..a647f87222 100644 --- a/source/components/localisation/utils.ts +++ b/source/components/localisation/utils.ts @@ -51,7 +51,7 @@ export function useSupportedRegion( const supportedRegions: SupportedRegions = useSelector( (state: AppState) => state.supportedRegions ) - + console.log(supportedRegions) // Check for undefined AFTER useSelector, because hooks can't be called conditionally if (inputCode === undefined) { return undefined