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

Fix a SonarQube warning #297

Merged
merged 4 commits into from
Feb 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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