mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-16 07:52:06 +08:00
refactor: optimize profile change notifications to use references
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user