Skip to content

Commit

Permalink
Clear generative direct answer state response on error
Browse files Browse the repository at this point in the history
J=CLIP-1226
TEST=auto

ran `npm run test`
  • Loading branch information
anguyen-yext2 committed Jun 20, 2024
1 parent 40c8918 commit 8482101
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yext/search-headless",
"version": "2.6.0-beta",
"version": "2.6.0-beta.2",
"description": "A library for powering UI components for Yext Search integrations",
"author": "slapshot@yext.com",
"license": "BSD-3-Clause",
Expand Down
1 change: 1 addition & 0 deletions src/search-headless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ export default class SearchHeadless {
} catch (e) {
const isLatestResponse = this.httpManager.processRequestId('generativeDirectAnswer', thisRequestId);
if (isLatestResponse) {
this.stateManager.dispatchEvent('generativeDirectAnswer/setResponse', undefined);
this.stateManager.dispatchEvent('generativeDirectAnswer/setIsLoading', false);
}
return Promise.reject(e);
Expand Down

0 comments on commit 8482101

Please sign in to comment.