Skip to content

Fix prop validation in ConfidenceTag

Erwan Rouchet requested to merge fix-confidence-validation into master

While reviewing !1388 (merged), I noticed that some unrelated Vue warnings were displayed:

image

It turns out the prop validator in the ConfidenceTag component used a statement that would never be true; a number is not an instance of Number because JavaScript is JavaScript, so number instanceof Number is false. Removing this statement causes TypeScript to cry because the value is not guaranteed to a number, so I changed the validator to use the correct type check, typeof value === 'number', which makes both JS and TS happy.

Those warnings would never have been caught by Sentry as they are only visible in dev, and they also have no effect at all on the working condition of the frontend; the confidences are still working perfectly fine.

Merge request reports

Loading