refactor: optimize profile change notifications to use references

This commit is contained in:
Tunglies
2026-02-20 17:58:04 +08:00
parent 5f573ca2d6
commit 119aaee546
5 changed files with 25 additions and 28 deletions
+2 -2
View File
@@ -116,7 +116,7 @@ async fn fetch_profile_item(url: &str, name: Option<&String>) -> Option<PrfItem>
async fn post_import_updates(uid: &String, had_current_profile: bool) {
handle::Handle::refresh_verge();
handle::Handle::notify_profile_changed(uid.clone());
handle::Handle::notify_profile_changed(uid);
tokio::time::sleep(Duration::from_millis(100)).await;
let should_update_core = if uid.is_empty() || had_current_profile {
@@ -125,7 +125,7 @@ async fn post_import_updates(uid: &String, had_current_profile: bool) {
let profiles = Config::profiles().await;
profiles.latest_arc().is_current_profile_index(uid)
};
handle::Handle::notify_profile_changed(uid.clone());
handle::Handle::notify_profile_changed(uid);
if should_update_core {
refresh_core_config().await;