Skip to content

Commit

Permalink
feat(ui): add fallback values instead of conditional rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
hdinia committed Oct 23, 2023
1 parent b7d51ee commit 3ada6ce
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions webapp/src/components/App/Studies/LauncherDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,21 +344,19 @@ function LauncherDialog(props: Props) {
/>
)}
</Box>
{cores && (
<Slider
sx={{
width: "95%",
mx: 1,
}}
defaultValue={cores.defaultValue}
step={1}
min={cores.min}
max={cores.max}
valueLabelDisplay="auto"
color="secondary"
onChange={(event, val) => handleChange("nb_cpu", val as number)}
/>
)}
<Slider
sx={{
width: "95%",
mx: 1,
}}
defaultValue={cores?.defaultValue || 14}
step={1}
min={cores?.min || 1}
max={cores?.max || 16}
valueLabelDisplay="auto"
color="secondary"
onChange={(event, val) => handleChange("nb_cpu", val as number)}
/>
</FormControl>
<Typography sx={{ mt: 1 }}>Xpansion</Typography>
<FormGroup
Expand Down

0 comments on commit 3ada6ce

Please sign in to comment.