mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
refactor: simplify version check logic in run_core_by_service and update tray menu function call
This commit is contained in:
@@ -845,11 +845,9 @@ pub(super) async fn run_core_by_service(config_file: &PathBuf) -> Result<()> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if version_check {
|
if version_check && is_service_available().await.is_ok() {
|
||||||
if is_service_available().await.is_ok() {
|
log::info!(target: "app", "服务已在运行且版本匹配,尝试使用");
|
||||||
log::info!(target: "app", "服务已在运行且版本匹配,尝试使用");
|
return start_with_existing_service(config_file).await;
|
||||||
return start_with_existing_service(config_file).await;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !version_check {
|
if !version_check {
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ impl Tray {
|
|||||||
match app_handle.tray_by_id("main") {
|
match app_handle.tray_by_id("main") {
|
||||||
Some(tray) => {
|
Some(tray) => {
|
||||||
let _ = tray.set_menu(Some(create_tray_menu(
|
let _ = tray.set_menu(Some(create_tray_menu(
|
||||||
&app_handle,
|
app_handle,
|
||||||
Some(mode.as_str()),
|
Some(mode.as_str()),
|
||||||
*system_proxy,
|
*system_proxy,
|
||||||
*tun_mode,
|
*tun_mode,
|
||||||
|
|||||||
Reference in New Issue
Block a user