Fix loading state not being cleared when design data loads successfully

The setLoading(false) call was only in the catch block, so when the API
call succeeded, the page would stay in a "Loading..." state indefinitely.
Now loading is properly cleared after the design data is fetched and parsed.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-18 18:08:02 +01:00
co-authored by Claude Haiku 4.5
parent 82f5c96fd3
commit 04f45c6e6b
+1
View File
@@ -61,6 +61,7 @@ export default function EditDesignPage({ params }: { params: { id: string } }) {
}
}
setDesign(data);
setLoading(false);
})
.catch((err) => {
console.error('Error fetching design:', err);