Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
Fix a SonarQube warning (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipewl authored and danzanzini committed Feb 7, 2022
1 parent ffb23aa commit 0769b16
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/ui/QuantitySelector/QuantitySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ export function QuantitySelector({

function validateQuantityBounds(n: number): number {
const maxValue = min ? Math.max(n, min) : n
const minValue = max ? Math.min(maxValue, max) : maxValue

return minValue
return max ? Math.min(maxValue, max) : maxValue
}

function validateInput(e: React.FormEvent<HTMLInputElement>) {
Expand Down

0 comments on commit 0769b16

Please sign in to comment.