fix: tray not update when delete profile (#6549)

This commit is contained in:
oomeow
2026-03-19 17:39:44 +00:00
committed by GitHub
parent fac897ae29
commit 27217a4b76
3 changed files with 25 additions and 23 deletions
+7
View File
@@ -173,6 +173,13 @@ pub async fn delete_profile(index: String) -> CmdResult {
// 使用Send-safe helper函数
let should_update = profiles_delete_item_safe(&index).await.stringify_err()?;
profiles_save_file_safe().await.stringify_err()?;
if let Err(e) = Tray::global().update_tooltip().await {
logging!(warn, Type::Cmd, "Warning: 异步更新托盘提示失败: {e}");
}
if let Err(e) = Tray::global().update_menu().await {
logging!(warn, Type::Cmd, "Warning: 异步更新托盘菜单失败: {e}");
}
if should_update {
Config::profiles().await.apply();
match CoreManager::global().update_config().await {