fix: improve error handling and logging in various modules

This commit is contained in:
Tunglies
2025-11-05 02:11:43 +08:00
parent 28483ff9db
commit 3e2f605e77
6 changed files with 63 additions and 35 deletions

View File

@@ -24,6 +24,8 @@ use futures::future::join_all;
use parking_lot::Mutex;
use smartstring::alias::String;
use std::collections::HashMap;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::{
sync::atomic::{AtomicBool, Ordering},
@@ -575,9 +577,6 @@ impl Tray {
return;
}
use std::future::Future;
use std::pin::Pin;
let fut: Pin<Box<dyn Future<Output = ()> + Send>> = match tray_event.as_str() {
"system_proxy" => Box::pin(async move {
feat::toggle_system_proxy().await;
@@ -1226,7 +1225,14 @@ fn on_menu_event(_: &AppHandle, event: MenuEvent) {
};
feat::switch_proxy_node(group_name, proxy_name).await;
}
_ => {}
_ => {
logging!(
debug,
Type::Tray,
"Unhandled tray menu event: {:?}",
event.id
);
}
}
// We dont expected to refresh tray state here