Clear localStorage draft when design submitted for approval

Also remove the designDraft from localStorage when submission succeeds,
so the cleared state doesn't get reloaded when the user creates another design.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-18 18:44:48 +01:00
co-authored by Claude Haiku 4.5
parent 5daa380e9d
commit dae1df444a
+1
View File
@@ -967,6 +967,7 @@ export default function DesignCanvas({ product, isAdminEditing = false }: { prod
setElementsBack([]);
// Save to localStorage so status persists on page reload
if (typeof window !== 'undefined') {
localStorage.removeItem(`designDraft_${product.id}`);
localStorage.setItem(`designApproval_${product.id}`, JSON.stringify({
id: design.id,
status: 'PENDING',