fix: do not kill sidecar during updating

This commit is contained in:
GyDi 2022-09-09 16:33:04 +08:00 committed by GitHub
parent ab53ab21e2
commit f32c5ba244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,6 @@ import {
} from "@mui/material"; } from "@mui/material";
import { relaunch } from "@tauri-apps/api/process"; import { relaunch } from "@tauri-apps/api/process";
import { checkUpdate, installUpdate } from "@tauri-apps/api/updater"; import { checkUpdate, installUpdate } from "@tauri-apps/api/updater";
import { killSidecar, restartSidecar } from "@/services/cmds";
import { atomUpdateState } from "@/services/states"; import { atomUpdateState } from "@/services/states";
import Notice from "../base/base-notice"; import Notice from "../base/base-notice";
@ -43,11 +42,9 @@ const UpdateDialog = (props: Props) => {
setUpdateState(true); setUpdateState(true);
try { try {
await killSidecar();
await installUpdate(); await installUpdate();
await relaunch(); await relaunch();
} catch (err: any) { } catch (err: any) {
await restartSidecar();
Notice.error(err?.message || err.toString()); Notice.error(err?.message || err.toString());
} finally { } finally {
setUpdateState(false); setUpdateState(false);