Skip to content

The agent that grows with you

fix(web): avoid synchronous blueprint effect state

ethernet341d61ee78dd
diff --git a/web/src/components/AutomationBlueprints.tsx b/web/src/components/AutomationBlueprints.tsx
index d85bb7a66b6..6d5a6a44ca2 100644
--- a/web/src/components/AutomationBlueprints.tsx
+++ b/web/src/components/AutomationBlueprints.tsx
@@ -178,12 +178,13 @@ export function AutomationBlueprints({ profile, onCreated }: AutomationBlueprint
useEffect(() => {
let cancelled = false;
- setBlueprints(null);
- setLoadError(null);
api
.getAutomationBlueprints(profile)
.then((r) => {
- if (!cancelled) setBlueprints(r.blueprints);
+ if (!cancelled) {
+ setLoadError(null);
+ setBlueprints(r.blueprints);
+ }
})
.catch((e) => {
if (!cancelled) setLoadError(errorMessage(e));