mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 03:03:46 +08:00
chore: avoid duplicate updates when tray rate is off
This commit is contained in:
parent
29ec4dc546
commit
a9b3d8885d
@ -316,6 +316,10 @@ impl Tray {
|
||||
Some(traffic) = stream.next() => {
|
||||
if let Ok(traffic) = traffic {
|
||||
let guard = speed_rate.lock();
|
||||
let enable_tray_speed: bool = Config::verge().latest().enable_tray_speed.unwrap_or(true);
|
||||
if !enable_tray_speed {
|
||||
continue;
|
||||
}
|
||||
if let Some(sr) = guard.as_ref() {
|
||||
if let Some(rate) = sr.update_and_check_changed(traffic.up, traffic.down) {
|
||||
let _ = Tray::global().update_icon(Some(rate));
|
||||
|
Loading…
x
Reference in New Issue
Block a user