Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: World Builder delete failure shouldn't double-toast and clear local state

Adam Eivy044438b0c6d3
diff --git a/client/src/pages/WorldBuilder.jsx b/client/src/pages/WorldBuilder.jsx
index dc1d3cec2b..525d85292a 100644
--- a/client/src/pages/WorldBuilder.jsx
+++ b/client/src/pages/WorldBuilder.jsx
@@ -229,7 +229,14 @@ export default function WorldBuilder() {
return;
}
const id = selectedId;
- await deleteWorld(id).catch((e) => toast.error(`Delete failed: ${e.message}`));
+ // Only update local UI + show success toast when the server confirmed the
+ // delete. Otherwise the user would see both a red "Delete failed" toast
+ // AND a green "World deleted" toast, with the world apparently gone from
+ // the sidebar even though it's still on disk.
+ const ok = await deleteWorld(id)
+ .then(() => true)
+ .catch((e) => { toast.error(`Delete failed: ${e.message}`); return false; });
+ if (!ok) return;
setWorlds((prev) => prev.filter((w) => w.id !== id));
setSelectedId(null);
setDraft(emptyTemplate());