Skip to content

Commit

Permalink
fix: 修复 app 无法自动更新的问题 (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayangweb authored Oct 20, 2024
1 parent 1dedc46 commit 0c6241a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/UpdateApp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ const UpdateApp = () => {
);
};

const handleOk = () => {
const handleOk = async () => {
state.loading = true;

state.update?.downloadAndInstall((progress) => {
await state.update?.downloadAndInstall((progress) => {
const { event } = progress;

switch (event) {
Expand All @@ -140,10 +140,12 @@ const UpdateApp = () => {
case "Progress":
state.download += progress.data.chunkLength;
break;
case "Finished":
return relaunch();
}
});

state.loading = false;

relaunch();
};

const handleCancel = () => {
Expand Down

0 comments on commit 0c6241a

Please sign in to comment.