Skip to content

Commit

Permalink
Fixed disable cancel update issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tangxianyun committed Jan 20, 2025
1 parent 4d1096d commit 18196db
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ const UpdateCard = () => {
setLoading(true);
const response = await settingService.checkUpdate();
setUpdateInformation(response);

setDialogOpen(true);
setLoading(false);
};

const handleUpdateClick = async () => {
setDownloadProgress(1);
const event = nanoid();
const onEvent = new Channel<DownloadEvent>();
onEvent.onmessage = (evt) => {
Expand Down Expand Up @@ -119,12 +119,13 @@ const UpdateCard = () => {
></LinearProgress>
</DialogContent>
<DialogActions>
<ButtonGroup fullWidth disabled={!updateInformation?.canUpdate}>
<ButtonGroup fullWidth>
<Button
color="error"
endIcon={<SystemUpdateAltIcon />}
onClick={handleUpdateClick}
loading={isDownloading}
disabled={!updateInformation?.canUpdate}
>
update
</Button>
Expand Down

0 comments on commit 18196db

Please sign in to comment.