perf(tray): drop the redundant full rebuild in update_part

update_part rebuilt the menu twice back to back: once without proxy groups,
then a spawned full update_menu. Keep the partial rebuild only.
This commit is contained in:
Tunglies
2026-11-16 23:24:35 +08:00
parent eacf138cc2
commit 6accebab3a
2 changed files with 8 additions and 5 deletions
-3
View File
@@ -342,9 +342,6 @@ impl Tray {
let verge = Config::verge().await.data_arc();
let app_handle = handle::Handle::app_handle();
self.update_menu_internal(app_handle, false).await?;
AsyncHandler::spawn(|| async {
logging_error!(Type::Tray, Self::global().update_menu().await);
});
self.update_icon(&verge).await?;
#[cfg(target_os = "macos")]
self.update_speed_task(verge.enable_tray_speed.unwrap_or(false));
+8 -2
View File
@@ -1447,7 +1447,10 @@ mod tests {
vec![],
HashMap::new(),
merge_item("global-merge"),
ChainItem::to_script("global-script", script),
ChainItem {
uid: "global-script".into(),
data: ChainType::Script(script.into()),
},
profile_name,
&authoritative,
)
@@ -1457,7 +1460,10 @@ mod tests {
keys,
logs,
merge_item("profile-merge"),
ChainItem::to_script("profile-script", script),
ChainItem {
uid: "profile-script".into(),
data: ChainType::Script(script.into()),
},
profile_name,
&authoritative,
)