Skip to content

Commit

Permalink
[GEN-1786]: fix max value for "ErrorSampler" (#1815)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenElferink authored Nov 21, 2024
1 parent 2a43875 commit a1d4e66
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ const ErrorSampler: React.FC<Props> = ({ value, setValue }) => {
const mappedValue = useMemo(() => safeJsonParse<Parsed>(value, { fallback_sampling_ratio: 0 }).fallback_sampling_ratio, [value]);

const handleChange = (val: string) => {
let num = Number(val);

if (Number.isNaN(num) || num < MIN || num > MAX) {
num = MIN;
}
const num = Math.max(MIN, Math.min(Number(val), MAX)) || MIN;

const payload: Parsed = {
fallback_sampling_ratio: num,
Expand Down

0 comments on commit a1d4e66

Please sign in to comment.