mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
fix: Update tray menu event handling to toggle lightweight mode based on current state #4785
This commit is contained in:
@@ -997,7 +997,12 @@ fn on_menu_event(_: &AppHandle, event: MenuEvent) {
|
||||
if !should_handle_tray_click() {
|
||||
return;
|
||||
}
|
||||
lightweight::entry_lightweight_mode().await; // Await async function
|
||||
|
||||
if !is_in_lightweight_mode() {
|
||||
lightweight::entry_lightweight_mode().await; // Await async function
|
||||
} else {
|
||||
lightweight::exit_lightweight_mode().await; // Await async function
|
||||
}
|
||||
}
|
||||
"quit" => {
|
||||
feat::quit().await; // Await async function
|
||||
|
||||
Reference in New Issue
Block a user