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

@@ -3,9 +3,11 @@ use crate::{
core::{handle, timer::Timer},
log_err, logging, logging_error,
utils::logging::Type,
AppHandleManager,
};
#[cfg(target_os = "macos")]
use crate::AppHandleManager;
use anyhow::{Context, Result};
use delay_timer::prelude::TaskBuilder;
use once_cell::sync::OnceCell;
@@ -112,6 +114,7 @@ pub fn exit_lightweight_mode() {
exit_lock.0 = false;
}
#[cfg(target_os = "macos")]
pub fn add_light_weight_timer() {
logging_error!(Type::Lightweight, setup_light_weight_timer());
}