Clear design state after submission for approval

After a design is successfully submitted for approval, clear the
elementsFront and elementsBack state so users start with a blank
canvas when creating their next design.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-18 18:43:39 +01:00
co-authored by Claude Haiku 4.5
parent 609cfdb7d6
commit 5daa380e9d
+3
View File
@@ -962,6 +962,9 @@ export default function DesignCanvas({ product, isAdminEditing = false }: { prod
setDesignApprovalId(design.id); setDesignApprovalId(design.id);
setApprovalStatus('PENDING'); setApprovalStatus('PENDING');
setSubmissionMessage(`✓ Design submitted for approval! You'll receive an email when it's ready to add to your bag.`); setSubmissionMessage(`✓ Design submitted for approval! You'll receive an email when it's ready to add to your bag.`);
// Clear design elements so user can start fresh
setElementsFront([]);
setElementsBack([]);
// Save to localStorage so status persists on page reload // Save to localStorage so status persists on page reload
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
localStorage.setItem(`designApproval_${product.id}`, JSON.stringify({ localStorage.setItem(`designApproval_${product.id}`, JSON.stringify({