diff --git a/.storybook/snapshots/__snapshots__/mapboxmap--custom-pin.png b/.storybook/snapshots/__snapshots__/mapboxmap--custom-pin.png index d7598477..2f97607a 100644 Binary files a/.storybook/snapshots/__snapshots__/mapboxmap--custom-pin.png and b/.storybook/snapshots/__snapshots__/mapboxmap--custom-pin.png differ diff --git a/.storybook/snapshots/__snapshots__/mapboxmap--custom-render-pin.png b/.storybook/snapshots/__snapshots__/mapboxmap--custom-render-pin.png index d7598477..2f97607a 100644 Binary files a/.storybook/snapshots/__snapshots__/mapboxmap--custom-render-pin.png and b/.storybook/snapshots/__snapshots__/mapboxmap--custom-render-pin.png differ diff --git a/.storybook/snapshots/__snapshots__/mapboxmap--primary.png b/.storybook/snapshots/__snapshots__/mapboxmap--primary.png index f4421b44..58da9f12 100644 Binary files a/.storybook/snapshots/__snapshots__/mapboxmap--primary.png and b/.storybook/snapshots/__snapshots__/mapboxmap--primary.png differ diff --git a/package-lock.json b/package-lock.json index ef032f61..7b1693c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@yext/search-ui-react", - "version": "1.7.0-beta.5", + "version": "1.7.0-beta.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@yext/search-ui-react", - "version": "1.7.0-beta.5", + "version": "1.7.0-beta.6", "license": "BSD-3-Clause", "dependencies": { "@restart/ui": "^1.0.1", diff --git a/package.json b/package.json index 2bf33276..b5410225 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yext/search-ui-react", - "version": "1.7.0-beta.5", + "version": "1.7.0-beta.6", "description": "A library of React Components for powering Yext Search integrations", "author": "slapshot@yext.com", "license": "BSD-3-Clause", diff --git a/src/components/GenerativeDirectAnswer.tsx b/src/components/GenerativeDirectAnswer.tsx index 17f668a1..c19ea9fa 100644 --- a/src/components/GenerativeDirectAnswer.tsx +++ b/src/components/GenerativeDirectAnswer.tsx @@ -75,6 +75,7 @@ export function GenerativeDirectAnswer({ const isUniversal = useSearchState(state => state.meta.searchType) === SearchTypeEnum.Universal; const universalResults = useSearchState(state => state.universal); const verticalResults = useSearchState(state => state.vertical); + const searchId = useSearchState(state => state.meta.uuid); const searchResults: Result[] | undefined = React.useMemo(() => { if (isUniversal) { @@ -89,11 +90,11 @@ export function GenerativeDirectAnswer({ const isLoading = useSearchState(state => state.generativeDirectAnswer?.isLoading); React.useEffect(() => { - if (!searchResults?.length) { + if (!searchResults?.length || !searchId) { return; } executeGenerativeDirectAnswer(searchActions); - }, [searchResults]); + }, [searchResults, searchId]); if (!searchResults?.length || isLoading || !gdaResponse || gdaResponse.resultStatus !== 'SUCCESS') { return null;