Skip to content

Commit

Permalink
fix(insight): literally just a single character! (#4841)
Browse files Browse the repository at this point in the history
### fix(insight): facet manager bindings error on disconnect callback

[SVCC-4338](https://coveord.atlassian.net/browse/SVCC-4338)

There was an error if you add the component to the DOM and then remove
it **without** calling initialize on the search interface, since
bindings are undefined, so I added an optional chaining operator on the
facet manager disconnect callback to not have an error!

It was not a big deal but mostly annoying in ServiceNow since it
displayed a huge error toast on the client side 😓

[SVCC-4338]:
https://coveord.atlassian.net/browse/SVCC-4338?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: Louis Bompart <[email protected]>
  • Loading branch information
mikegron and louis-bompart authored Jan 10, 2025
1 parent 5b3a877 commit 7b7e2b8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class AtomicFacetManager implements InitializableComponent {
}

disconnectedCallback() {
this.bindings.i18n.off('languageChanged', this.sortFacets);
this.bindings?.i18n.off('languageChanged', this.sortFacets);
}

public render() {
Expand Down

0 comments on commit 7b7e2b8

Please sign in to comment.