Skip to content

Commit

Permalink
feat(ui): remove redundant first confirmation dialog for fetching upd…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
Hypfer committed Oct 31, 2022
1 parent 67e66a0 commit 4d01657
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions frontend/src/valetudo/Updater.tsx
Expand Up @@ -271,34 +271,20 @@ const StartUpdateControls: React.FunctionComponent<{
}> = ({
busyState
}) => {
const [dialogOpen, setDialogOpen] = React.useState(false);
const {mutate: sendCommand, isLoading: commandExecuting} = useUpdaterCommandMutation();

return (
<>
<LoadingButton
loading={commandExecuting}
variant="outlined"
disabled={busyState}
onClick={() => {
setDialogOpen(true);
}}
sx={{mt: 1, mb: 1}}
>
Check for Updates
</LoadingButton>
<ConfirmationDialog
title="Check for Updates?"
text="Do you want to check for a new version of Valetudo?"
open={dialogOpen}
onClose={() => {
setDialogOpen(false);
}}
onAccept={() => {
sendCommand("check");
}}
/>
</>
<LoadingButton
loading={commandExecuting}
variant="outlined"
disabled={busyState}
onClick={() => {
sendCommand("check");
}}
sx={{mt: 1, mb: 1}}
>
Check for Updates
</LoadingButton>
);
};

Expand Down

0 comments on commit 4d01657

Please sign in to comment.