feat(hotkey): add global reactivate_profiles shortcut (#5527)

* feat(hotkey): add global reactivate_profiles shortcut

* feat(profile): expose validation state for reactivation shortcuts
This commit is contained in:
Sline
2025-11-19 17:06:23 +08:00
committed by GitHub
parent 94b07b51d6
commit f439e93a2b
34 changed files with 134 additions and 22 deletions

View File

@@ -36,14 +36,29 @@ pub async fn get_profiles() -> CmdResult<IProfiles> {
#[tauri::command]
pub async fn enhance_profiles() -> CmdResult {
match feat::enhance_profiles().await {
Ok(_) => {}
Ok((true, _)) => {
handle::Handle::refresh_clash();
Ok(())
}
Ok((false, msg)) => {
let message: String = if msg.is_empty() {
"Failed to reactivate profiles".into()
} else {
msg
};
logging!(
warn,
Type::Cmd,
"Reactivate profiles command failed validation: {}",
message.as_str()
);
Err(message)
}
Err(e) => {
logging!(error, Type::Cmd, "{}", e);
return Err(e.to_string().into());
Err(e.to_string().into())
}
}
handle::Handle::refresh_clash();
Ok(())
}
/// 导入配置文件