Add logging to debug approval status clearing

Log when addText is called and whether approvalStatus is being cleared
to help debug why the old approval message persists.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-18 18:58:05 +01:00
co-authored by Claude Haiku 4.5
parent 63ae432793
commit c9a7cab349
+4
View File
@@ -642,11 +642,15 @@ export default function DesignCanvas({ product, isAdminEditing = false }: { prod
const addText = () => { const addText = () => {
// Clear old approval status when starting a new design // Clear old approval status when starting a new design
if (approvalStatus) { if (approvalStatus) {
console.log('🧹 Clearing old approval status:', approvalStatus);
setApprovalStatus(null); setApprovalStatus(null);
setDesignApprovalId(null); setDesignApprovalId(null);
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
localStorage.removeItem(`designApproval_${product.id}`); localStorage.removeItem(`designApproval_${product.id}`);
console.log('✓ Removed designApproval from localStorage');
} }
} else {
console.log('No approval status to clear');
} }
const id = uuid(); const id = uuid();
setActiveElements((prev) => [ setActiveElements((prev) => [