From feac8085c97123852f7d8f549541a8fe0d512faf Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Tue, 5 Dec 2023 15:01:15 +0800 Subject: [PATCH] fix: Stop core before install update --- src-tauri/src/main.rs | 4 ++++ src/components/setting/mods/update-viewer.tsx | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f47910ad..2bebc9b2 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -105,6 +105,10 @@ fn main() -> std::io::Result<()> { api::process::kill_children(); app_handle.exit(0); } + tauri::RunEvent::Updater(tauri::UpdaterEvent::Downloaded) => { + resolve::resolve_reset(); + api::process::kill_children(); + } #[cfg(target_os = "macos")] tauri::RunEvent::WindowEvent { label, event, .. } => { use tauri::Manager; diff --git a/src/components/setting/mods/update-viewer.tsx b/src/components/setting/mods/update-viewer.tsx index 66ed426b..b201c8e9 100644 --- a/src/components/setting/mods/update-viewer.tsx +++ b/src/components/setting/mods/update-viewer.tsx @@ -75,14 +75,17 @@ export const UpdateViewer = forwardRef((props, ref) => { setOpen(false)} onCancel={() => setOpen(false)} onOk={onUpdate} > - + {updateState && (