mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 02:52:07 +08:00
refactor: update update_icon method to require a non-optional verge reference and adjust related calls (#5417)
This commit is contained in:
@@ -82,7 +82,12 @@ pub async fn change_clash_mode(mode: String) {
|
||||
if clash_data.save_config().await.is_ok() {
|
||||
handle::Handle::refresh_clash();
|
||||
logging_error!(Type::Tray, tray::Tray::global().update_menu().await);
|
||||
logging_error!(Type::Tray, tray::Tray::global().update_icon(None).await);
|
||||
logging_error!(
|
||||
Type::Tray,
|
||||
tray::Tray::global()
|
||||
.update_icon(&Config::verge().await.data_arc())
|
||||
.await
|
||||
);
|
||||
}
|
||||
|
||||
let is_auto_close_connection = Config::verge()
|
||||
|
||||
@@ -22,7 +22,12 @@ pub async fn patch_clash(patch: Mapping) -> Result<()> {
|
||||
} else {
|
||||
if patch.get("mode").is_some() {
|
||||
logging_error!(Type::Tray, tray::Tray::global().update_menu().await);
|
||||
logging_error!(Type::Tray, tray::Tray::global().update_icon(None).await);
|
||||
logging_error!(
|
||||
Type::Tray,
|
||||
tray::Tray::global()
|
||||
.update_icon(&Config::verge().await.data_arc())
|
||||
.await
|
||||
);
|
||||
}
|
||||
Config::runtime()
|
||||
.await
|
||||
@@ -213,7 +218,7 @@ async fn process_terminated_flags(update_flags: i32, patch: &IVerge) -> Result<(
|
||||
}
|
||||
if (update_flags & (UpdateFlags::SystrayIcon as i32)) != 0 {
|
||||
tray::Tray::global()
|
||||
.update_icon(Some(&Config::verge().await.latest_arc()))
|
||||
.update_icon(&Config::verge().await.data_arc())
|
||||
.await?;
|
||||
}
|
||||
if (update_flags & (UpdateFlags::SystrayTooltip as i32)) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user