move resetting logic

This commit is contained in:
Kroell 2023-05-05 09:45:47 -04:00
parent bb055c4806
commit 0003de236f

View file

@ -180,13 +180,6 @@ export default {
return tintSourceObject.src; return tintSourceObject.src;
}, },
// Reset selections when tint changes for the same glass to ensure proper selection.
// Also checks if only a single part is present for the tint.
ResetTintAndPartSelections() {
this.selectedPartNumber = null;
this.AutoSelectIfSinglePart();
},
AutoSelectIfSinglePart() { AutoSelectIfSinglePart() {
if (this.partsForSelectedTint?.length > 0) if (this.partsForSelectedTint?.length > 0)
{ {
@ -201,6 +194,9 @@ export default {
radioInput?.click(); radioInput?.click();
}); });
} }
else {
this.selectedPartNumber = null;
}
} }
}, },
@ -217,7 +213,7 @@ export default {
}, },
watch: { watch: {
selectedTint() { selectedTint() {
this.ResetTintAndPartSelections(); this.AutoSelectIfSinglePart();
}, },
}, },
}; };