mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 00:43:44 +08:00
fix: tray tooltip not updating
This commit is contained in:
parent
f2cc116ff9
commit
5bff7ea469
@ -4,7 +4,7 @@ use crate::{
|
||||
feat,
|
||||
utils::{dirs, help},
|
||||
};
|
||||
use crate::{ret_err, wrap_err};
|
||||
use crate::{log_err, ret_err, wrap_err};
|
||||
use anyhow::{Context, Result};
|
||||
use network_interface::NetworkInterface;
|
||||
use serde_yaml::Mapping;
|
||||
@ -28,6 +28,7 @@ pub fn get_profiles() -> CmdResult<IProfiles> {
|
||||
#[tauri::command]
|
||||
pub async fn enhance_profiles() -> CmdResult {
|
||||
wrap_err!(CoreManager::global().update_config().await)?;
|
||||
log_err!(tray::Tray::global().update_tooltip());
|
||||
handle::Handle::refresh_clash();
|
||||
Ok(())
|
||||
}
|
||||
|
@ -205,10 +205,12 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
|
||||
let mut should_update_systray_icon = false;
|
||||
let mut should_update_hotkey = false;
|
||||
let mut should_update_systray_menu = false;
|
||||
let mut should_update_systray_tooltip = false;
|
||||
|
||||
if tun_mode.is_some() {
|
||||
should_update_clash_config = true;
|
||||
should_update_systray_menu = true;
|
||||
should_update_systray_tooltip = true;
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
should_update_systray_icon = true;
|
||||
@ -239,6 +241,7 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
|
||||
if system_proxy.is_some() {
|
||||
should_update_sysproxy = true;
|
||||
should_update_systray_menu = true;
|
||||
should_update_systray_tooltip = true;
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
should_update_systray_icon = true;
|
||||
@ -292,6 +295,9 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
|
||||
tray::Tray::global().update_icon(None)?;
|
||||
}
|
||||
|
||||
if should_update_systray_tooltip {
|
||||
tray::Tray::global().update_tooltip()?;
|
||||
}
|
||||
<Result<()>>::Ok(())
|
||||
};
|
||||
match res {
|
||||
|
Loading…
x
Reference in New Issue
Block a user