chore: update

This commit is contained in:
huzibaca 2025-01-01 08:25:31 +08:00
parent 0b44d40b39
commit b9a220cb63

View File

@ -203,6 +203,8 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
let mut should_update_launch = false; let mut should_update_launch = false;
let mut should_update_sysproxy = false; let mut should_update_sysproxy = false;
let mut should_update_systray_icon = false; let mut should_update_systray_icon = false;
let mut should_update_hotkey = false;
let mut should_update_systray_menu = false;
if tun_mode.is_some() { if tun_mode.is_some() {
should_update_clash_config = true; should_update_clash_config = true;
@ -247,6 +249,12 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
{ {
should_update_systray_icon = true; should_update_systray_icon = true;
} }
if patch.hotkeys.is_some() {
should_update_hotkey = true;
should_update_systray_menu = true;
}
if should_restart_core { if should_restart_core {
CoreManager::global().restart_core().await?; CoreManager::global().restart_core().await?;
} }
@ -262,8 +270,11 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
sysopt::Sysopt::global().update_sysproxy().await?; sysopt::Sysopt::global().update_sysproxy().await?;
} }
if let Some(hotkeys) = patch.hotkeys { if should_update_hotkey {
hotkey::Hotkey::global().update(hotkeys)?; hotkey::Hotkey::global().update(patch.hotkeys.unwrap())?;
}
if should_update_systray_menu {
tray::Tray::global().update_menu()?; tray::Tray::global().update_menu()?;
} }