refactor: convert async functions to synchronous for UWP tool invocation

This commit is contained in:
Tunglies
2025-08-17 16:07:49 +08:00
Unverified
parent 7b35ee513a
commit 1065f224a9
3 changed files with 6 additions and 4 deletions

View File

@@ -6,8 +6,8 @@ mod platform {
use super::CmdResult;
use crate::{core::win_uwp, wrap_err};
pub async fn invoke_uwp_tool() -> CmdResult {
wrap_err!(win_uwp::invoke_uwptools().await)
pub fn invoke_uwp_tool() -> CmdResult {
wrap_err!(win_uwp::invoke_uwptools())
}
}
@@ -24,5 +24,5 @@ mod platform {
/// Command exposed to Tauri
#[tauri::command]
pub async fn invoke_uwp_tool() -> CmdResult {
platform::invoke_uwp_tool().await
platform::invoke_uwp_tool()
}

View File

@@ -520,6 +520,7 @@ impl EventDrivenProxyManager {
{
logging_error!(
Type::System,
"{}",
Self::execute_sysproxy_command(&["pac", expected_url])
);
}
@@ -536,6 +537,7 @@ impl EventDrivenProxyManager {
let address = format!("{}:{}", expected.host, expected.port);
logging_error!(
Type::System,
"{}",
Self::execute_sysproxy_command(&["global", &address, &expected.bypass])
);
}

View File

@@ -6,7 +6,7 @@ use deelevate::{PrivilegeLevel, Token};
use runas::Command as RunasCommand;
use std::process::Command as StdCommand;
pub async fn invoke_uwptools() -> Result<()> {
pub fn invoke_uwptools() -> Result<()> {
let resource_dir = dirs::app_resources_dir()?;
let tool_path = resource_dir.join("enableLoopback.exe");