Workspaces: deleting the current workspace saves after switching to Default (#696)

This commit is contained in:
tylerjenningsw
2026-10-12 21:07:39 -04:00
parent 470ea7a3af
commit 765915e126
2 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -1054,10 +1054,11 @@ pub fn frontend(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, p: Valu
if app.ui.saved_workspaces.remove(&name).is_none() && !builtin {
return Err(format!("no workspace `{name}`"));
}
app.store_saved_workspaces();
// Leave the deleted workspace first: a current workspace needs a definition.
if app.ui.workspace == name {
app.set_workspace("Default");
}
app.store_saved_workspaces();
return Ok(json!({"deleted": name}));
}
if let Some(new) = p.get("rename").and_then(Value::as_str).map(str::trim).filter(|n| !n.is_empty() && *n != name) {