fix: resolve crashes when exiting lightweight mode by ensuring async window operations

This commit is contained in:
Tunglies
2025-08-30 20:04:21 +08:00
parent c09066c0a3
commit 92d9c94e87
5 changed files with 20 additions and 18 deletions

View File

@@ -34,12 +34,12 @@ async fn open_or_close_dashboard_internal(bypass_debounce: bool) {
log::info!(target: "app", "Currently in lightweight mode, exiting lightweight mode");
crate::module::lightweight::exit_lightweight_mode().await;
log::info!(target: "app", "Creating new window after exiting lightweight mode");
let result = WindowManager::show_main_window();
let result = WindowManager::show_main_window().await;
log::info!(target: "app", "Window operation result: {result:?}");
return;
}
let result = WindowManager::toggle_main_window();
let result = WindowManager::toggle_main_window().await;
log::info!(target: "app", "Window toggle result: {result:?}");
return;
}
@@ -47,12 +47,12 @@ async fn open_or_close_dashboard_internal(bypass_debounce: bool) {
log::info!(target: "app", "Currently in lightweight mode, exiting lightweight mode");
crate::module::lightweight::exit_lightweight_mode().await;
log::info!(target: "app", "Creating new window after exiting lightweight mode");
let result = WindowManager::show_main_window();
let result = WindowManager::show_main_window().await;
log::info!(target: "app", "Window operation result: {result:?}");
return;
}
let result = WindowManager::toggle_main_window();
let result = WindowManager::toggle_main_window().await;
log::info!(target: "app", "Window toggle result: {result:?}");
}