fix(desktop): allow native quit before frontend ready

This commit is contained in:
t8y2 committed 2026-07-21 18:45:02 +08:00
1 parent c153e93d54
commit 1410c92710
3 files changed
+59 -6

No files matched your search

+8
View File
@@ -59,6 +59,14 @@ pub async fn complete_app_close(app: AppHandle, window: Window, action: String)
Ok(())
}
#[tauri::command]
pub fn mark_frontend_ready(app: AppHandle) -> Result<(), String> {
let state =
app.try_state::<CloseBehaviorState>().ok_or_else(|| "close behavior state is unavailable".to_string())?;
state.set_frontend_ready(true);
Ok(())
}
#[tauri::command]
pub async fn request_app_close_from_window_controls(app: AppHandle) -> Result<(), String> {
request_app_close(&app, "settings");