refactor(profile): call the core reload directly

This commit is contained in:
Tunglies
2026-12-03 19:38:46 +08:00
parent 651f297785
commit 35dbb3716d
3 changed files with 8 additions and 9 deletions
+6 -2
View File
@@ -3,7 +3,11 @@ use crate::process::AsyncHandler;
use crate::singleton;
use crate::utils::notification::{NotificationEvent, notify_event};
use crate::utils::window_manager::WindowManager;
use crate::{config::Config, core::handle, core::lightweight::entry_lightweight_mode, feat};
use crate::{
config::Config,
core::{CoreManager, handle, lightweight::entry_lightweight_mode},
feat,
};
use anyhow::{Result, bail};
use arc_swap::ArcSwap;
use clash_verge_logging::{Type, logging};
@@ -165,7 +169,7 @@ impl Hotkey {
});
}
HotkeyFunction::ReactivateProfiles => {
AsyncHandler::spawn(async move || match feat::enhance_profiles().await {
AsyncHandler::spawn(async move || match CoreManager::global().update_config_forced().await {
Ok(outcome) if outcome.is_valid() => {
handle::Handle::refresh_clash();
notify_event(NotificationEvent::ProfilesReactivated).await;