Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(insights): fix the regression that it didn't send events with instantsearch.insights() #4519

Merged
merged 2 commits into from Sep 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/insights/listener.tsx
Expand Up @@ -58,7 +58,9 @@ const insightsListener = (BaseComponent: any) => {
const payload = parseInsightsEvent(targetWithEvent);
props.sendEvent(payload);
}
} else {
}

{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prop.sendEvent exists, so it always followed the first if branch. We should run them both.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we should run them both, you should probably remove the curly brace here and on line 72

// old way, e.g. instantsearch.insights("clickedObjectIDsAfterSearch", { .. })
const insightsTarget = findInsightsTarget(
event.target as HTMLElement | null,
Expand Down