Skip to content

Commit

Permalink
fix enable button for cloud engines (closes #145)
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Feb 8, 2024
1 parent 67bc1ba commit 8d02621
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/components/engines/EnginesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,14 @@ export default function EnginesPage() {
<Checkbox
label="Enabled"
checked={!!selectedEngine.loaded}
onChange={(e) =>
onChange={(e) => {
const checked = e.currentTarget.checked;
setEngines(async (prev) => {
const copy = [...(await prev)];
copy[selected].loaded = e.currentTarget.checked;
copy[selected].loaded = checked;
return copy;
})
}
});
}}
/>

<Divider variant="dashed" label="Advanced Settings" />
Expand Down Expand Up @@ -190,6 +191,22 @@ export default function EnginesPage() {
}}
/>
</Stack>

<Group justify="right">
<Button
color="red"
onClick={() => {
setEngines(async (prev) => {
const copy = [...(await prev)];
copy.splice(selected, 1);
return copy;
});
setSelected(null);
}}
>
Remove
</Button>
</Group>
</Stack>
)}
</Paper>
Expand Down

0 comments on commit 8d02621

Please sign in to comment.