Skip to content

Commit

Permalink
Fix searches with percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
thalytafabrine committed Jul 2, 2021
1 parent c47364c commit c3836ef
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed
- Autocomplete did not display products for search terms with percentage.

## [2.8.1] - 2021-06-29

### Added
Expand Down
33 changes: 23 additions & 10 deletions react/utils/pixel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,27 @@ export function handleAutocompleteSearch(
count: number,
term: string
) {
push({
event: EVENT_NAME,
eventType: EventType.Search,
search: {
operator,
misspelled,
text: decodeURI(term),
match: count,
},
})
try {
push({
event: EVENT_NAME,
eventType: EventType.Search,
search: {
operator,
misspelled,
text: decodeURI(term),
match: count,
},
})
} catch (e) {
push({
event: EVENT_NAME,
eventType: EventType.Search,
search: {
operator,
misspelled,
text: term,
match: count,
},
})
}
}

0 comments on commit c3836ef

Please sign in to comment.