Skip to content

Commit

Permalink
fix(ui-lancher): cores limit cannot be break
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril committed Nov 29, 2023
1 parent 4267028 commit d3f4b79
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webapp/src/components/App/Studies/LauncherDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,13 @@ function LauncherDialog(props: Props) {
type="number"
variant="filled"
value={options.nb_cpu}
onChange={(e) =>
handleChange("nb_cpu", parseInt(e.target.value, 10))
}
onChange={(e) => {
const newValue = parseInt(e.target.value, 10);
handleChange(
"nb_cpu",
Math.min(Math.max(newValue, cores.min), cores.max),
);
}}
inputProps={{
min: cores.min,
max: cores.max,
Expand Down

0 comments on commit d3f4b79

Please sign in to comment.