mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 03:32:36 +08:00
fix: adjust something
This commit is contained in:
parent
5308970ad8
commit
557f5fe364
|
@ -263,8 +263,10 @@ pub mod service {
|
|||
|
||||
#[tauri::command]
|
||||
pub async fn install_service() -> Result<(), String> {
|
||||
wrap_err!(crate::core::Service::install_service().await)?;
|
||||
wrap_err!(crate::core::Service::start_service().await)
|
||||
log_if_err!(crate::core::Service::install_service().await);
|
||||
let ret = wrap_err!(crate::core::Service::start_service().await);
|
||||
log::info!("clash verge service started successfully");
|
||||
ret
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
|
@ -85,8 +85,7 @@ fn main() -> std::io::Result<()> {
|
|||
}
|
||||
"quit" => {
|
||||
resolve::resolve_reset(app_handle);
|
||||
api::process::kill_children();
|
||||
std::process::exit(0);
|
||||
app_handle.exit(0);
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
|
|
|
@ -22,8 +22,11 @@ pub fn resolve_setup(app: &App) {
|
|||
pub fn resolve_reset(app_handle: &AppHandle) {
|
||||
let core = app_handle.state::<Core>();
|
||||
let mut sysopt = core.sysopt.lock();
|
||||
|
||||
sysopt.reset_sysproxy();
|
||||
drop(sysopt);
|
||||
|
||||
let mut service = core.service.lock();
|
||||
crate::log_if_err!(service.stop());
|
||||
}
|
||||
|
||||
/// customize the window theme
|
||||
|
|
|
@ -41,8 +41,8 @@ const ServiceMode = (props: Props) => {
|
|||
try {
|
||||
await installService();
|
||||
mutate("checkService");
|
||||
Notice.success("Service installed successfully");
|
||||
onClose();
|
||||
Notice.success("Service installed successfully");
|
||||
} catch (err: any) {
|
||||
mutate("checkService");
|
||||
onError(err);
|
||||
|
@ -56,9 +56,9 @@ const ServiceMode = (props: Props) => {
|
|||
}
|
||||
|
||||
await uninstallService();
|
||||
Notice.success("Service uninstalled successfully");
|
||||
mutate("checkService");
|
||||
onClose();
|
||||
Notice.success("Service uninstalled successfully");
|
||||
} catch (err: any) {
|
||||
mutate("checkService");
|
||||
onError(err);
|
||||
|
|
Loading…
Reference in New Issue
Block a user