CSR-1383: refactor improvement

This commit is contained in:
Adam Caouette 2023-09-29 10:12:47 -04:00
parent eb4d71f68d
commit 8d35070585

View file

@ -42,17 +42,15 @@ export default {
isDisplayed() {
return this.showAddRainDefense || this.showAddWipers;
},
showAddRainDefense() {
const rainDefenseIndex = this.cart.findIndex((vap) => {
showAddRainDefense() { // if it's not found in the cart
return !this.cart.some((vap) => {
return vap.partType === "RAIN DEFENSE";
});
return rainDefenseIndex > -1 ? false : true;
},
showAddWipers() {
const rainDefenseIndex = this.cart.findIndex((vap) => {
showAddWipers() { // if it's not found in the cart
return !this.cart.some((vap) => {
return vap.partType.includes(" WIPER");
});
return rainDefenseIndex > -1 ? false : true;
},
rainDefensePrice() {
const lineItem = this.rainDefenseItem;