Skip to content

Commit

Permalink
Send SELECT_SEARCH_RESULT event only on left-mouse clicks (#3472)
Browse files Browse the repository at this point in the history
* Add check for left click before sending search result event

* correct event code

* Revert "correct event code"

This reverts commit aba8ff1.

* correct event code

* Lint

Signed-off-by: Olga Bulat <obulat@gmail.com>

---------

Signed-off-by: Olga Bulat <obulat@gmail.com>
Co-authored-by: Olga Bulat <obulat@gmail.com>
  • Loading branch information
aneevel and obulat authored Dec 19, 2023
1 parent 62807d3 commit 6d6b123
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/components/VImageCell/VImageCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,15 @@ export default defineComponent({
})
const { sendCustomEvent } = useAnalytics()
const sendSelectSearchResultEvent = () => {
/**
* If the user left clicks on a search result, send
* the SELECT_SEARCH_RESULT custom event
* @param event - the mouse click event
*/
const sendSelectSearchResultEvent = (event: MouseEvent) => {
if (event.button !== 0) return
sendCustomEvent("SELECT_SEARCH_RESULT", {
id: props.image.id,
kind: props.kind,
Expand Down

0 comments on commit 6d6b123

Please sign in to comment.