Skip to content

Commit

Permalink
Website: Make sure ratings passes correct values (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackw authored Aug 9, 2024
1 parent 10b62be commit a22b1dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docusaurus/website/src/components/Rating/Rating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ export function Rating() {
const [storageValue, setStorageValue] = useRatingStorage(pageId);
const faroIsConfigured = isFaroSetup(customFields.faroConfig as FaroConfig);
const shouldTrack = customFields.nodeEnv === 'production';
const onClick = (rating) => {
const onClick = (rating: string) => {
if (shouldTrack && faroIsConfigured) {
faro.api.pushMeasurement(
{
type: 'docs_feedback',
// website doesn't include this but pushMeasurement types require it
values: {
rating: rating,
rating: rating === 'yes' ? 1 : 0,
},
},
{
Expand Down

0 comments on commit a22b1dc

Please sign in to comment.