refactor: streamline macOS-specific code by consolidating conditional imports and logic in sysopt, tray, lightweight, and mihomo modules

This commit is contained in:
Tunglies
2025-06-11 00:19:06 +08:00
parent 25cfd162f6
commit 5cf3e1a817
5 changed files with 81 additions and 50 deletions

View File

@@ -235,13 +235,11 @@ impl Sysopt {
} else {
return Ok(());
}
} else if let Err(e) = startup_shortcut::remove_shortcut() {
log::error!(target: "app", "删除启动快捷方式失败: {}", e);
self.try_original_autostart_method(is_enable);
} else {
if let Err(e) = startup_shortcut::remove_shortcut() {
log::error!(target: "app", "删除启动快捷方式失败: {}", e);
self.try_original_autostart_method(is_enable);
} else {
return Ok(());
}
return Ok(());
}
}