diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index cd55aa3..2310919 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -542,7 +542,12 @@ export function OrderWizard({ const nextStep = () => { if (step === 3 && allCategoriesFilled && productValidationErrors.length === 0) { - if (hasActiveSelection) { + const isDirtyNewDevice = deviceName.trim() !== '' || licenseNumber.trim() !== '' || Object.values(moduleQuantities).some(q => q > 0) + if (editingIdx !== null) { + addToBasket() + } else if (basketItems.length === 0 && hasActiveSelection) { + addToBasket() + } else if (isDirtyNewDevice && hasActiveSelection) { addToBasket() } } @@ -738,7 +743,8 @@ export function OrderWizard({ setIsSubmitting(true) try { let finalItems = [...basketItems] - if (hasActiveSelection && allCategoriesFilled && productValidationErrors.length === 0) { + const isDirtyNewDevice = deviceName.trim() !== '' || licenseNumber.trim() !== '' || Object.values(moduleQuantities).some(q => q > 0) + if ((editingIdx !== null || basketItems.length === 0 || isDirtyNewDevice) && hasActiveSelection && allCategoriesFilled && productValidationErrors.length === 0) { const normLicense = licenseNumber.trim().toUpperCase() if (normLicense) { const isDuplicateInBasket = basketItems.some(