mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-13 13:30:31 +08:00
refactor(window): avoid double toggle (#6377)
This commit is contained in:
parent
262b6f8adf
commit
a7a4c3e59c
@ -6,14 +6,12 @@ use crate::utils::window_manager::WindowManager;
|
|||||||
use clash_verge_logging::{Type, logging};
|
use clash_verge_logging::{Type, logging};
|
||||||
use tokio::time::{Duration, timeout};
|
use tokio::time::{Duration, timeout};
|
||||||
|
|
||||||
/// Public API: open or close the dashboard
|
|
||||||
pub async fn open_or_close_dashboard() {
|
pub async fn open_or_close_dashboard() {
|
||||||
open_or_close_dashboard_internal().await
|
if lightweight::is_in_lightweight_mode() {
|
||||||
}
|
let _ = lightweight::exit_lightweight_mode().await;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/// Internal implementation for opening/closing dashboard
|
|
||||||
async fn open_or_close_dashboard_internal() {
|
|
||||||
let _ = lightweight::exit_lightweight_mode().await;
|
|
||||||
let result = WindowManager::toggle_main_window().await;
|
let result = WindowManager::toggle_main_window().await;
|
||||||
logging!(info, Type::Window, "Window toggle result: {result:?}");
|
logging!(info, Type::Window, "Window toggle result: {result:?}");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user