mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: add methods to retrieve current subscription details in PrfItem and refactor profile handling in IProfiles
This commit is contained in:
@@ -455,7 +455,7 @@ impl Tray {
|
||||
let profiles = Config::profiles().await;
|
||||
let profiles = profiles.latest_arc();
|
||||
if let Some(current_profile_uid) = profiles.get_current()
|
||||
&& let Ok(profile) = profiles.get_item(¤t_profile_uid)
|
||||
&& let Ok(profile) = profiles.get_item(current_profile_uid)
|
||||
{
|
||||
current_profile_name = match &profile.name {
|
||||
Some(profile_name) => profile_name.to_string(),
|
||||
@@ -842,7 +842,7 @@ async fn create_tray_menu(
|
||||
let profiles_ref = profiles_config.latest_arc();
|
||||
profiles_ref
|
||||
.get_current()
|
||||
.and_then(|uid| profiles_ref.get_item(&uid).ok())
|
||||
.and_then(|uid| profiles_ref.get_item(uid).ok())
|
||||
.and_then(|profile| profile.selected.clone())
|
||||
.unwrap_or_default()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user