This commit is contained in:
Julian Freeman
2026-03-14 22:48:10 -04:00
parent f83ccbe2da
commit 714db81938
2 changed files with 35 additions and 23 deletions

View File

@@ -36,6 +36,7 @@ pub fn emit_log(handle: &AppHandle, id: &str, command: &str, output: &str, statu
#[tauri::command]
async fn initialize_app(app: AppHandle) -> Result<bool, String> {
// 统一由前端触发环境初始化
tokio::task::spawn_blocking(move || {
ensure_winget_dependencies(&app).map(|_| true)
}).await.unwrap_or(Err("Initialization Task Panicked".to_string()))
@@ -115,12 +116,7 @@ pub fn run() {
let (tx, mut rx) = mpsc::channel::<String>(100);
app.manage(AppState { install_tx: tx });
let init_handle = handle.clone();
tauri::async_runtime::spawn(async move {
let _ = tokio::task::spawn_blocking(move || {
let _ = ensure_winget_dependencies(&init_handle);
}).await;
});
// 移除了 setup 钩子中的 redundancy initialize_app 调用
// 安装队列处理器
tauri::async_runtime::spawn(async move {
@@ -188,7 +184,6 @@ pub fn run() {
}
if !is_progress {
// 追加内容到同一个日志卡片
emit_log(&h, &log_id, "", clean_line, "info");
}
}