mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-17 01:02:08 +08:00
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:
@@ -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));
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user