fix(web): omit desktop exit guards from wasm

This commit is contained in:
WuYongJie 2026-11-26 19:40:58 +08:00
parent dd953287d6
commit ec5ba7fcd6
2 changed files with 2 additions and 0 deletions

View File

@ -125,6 +125,7 @@ pub fn guard_window_close(app: &mut PhotocraftApp, ctx: &egui::Context) {
if !ctx.input(|i| i.viewport().close_requested()) {
return;
}
#[cfg(not(target_arch = "wasm32"))]
if crate::jiansun::guard_production_exit(app, ctx) {
ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose);
return;

View File

@ -45,6 +45,7 @@ pub fn invoke(app: &mut PhotocraftApp, ctx: &egui::Context, id: &str, params: Va
{
authorize(id, &params)?;
}
#[cfg(not(target_arch = "wasm32"))]
if id == "file.exit" && crate::jiansun::guard_production_exit(app, ctx) {
return Ok(Value::Null);
}