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() { isDisplayed() {
return this.showAddRainDefense || this.showAddWipers; return this.showAddRainDefense || this.showAddWipers;
}, },
showAddRainDefense() { showAddRainDefense() { // if it's not found in the cart
const rainDefenseIndex = this.cart.findIndex((vap) => { return !this.cart.some((vap) => {
return vap.partType === "RAIN DEFENSE"; return vap.partType === "RAIN DEFENSE";
}); });
return rainDefenseIndex > -1 ? false : true;
}, },
showAddWipers() { showAddWipers() { // if it's not found in the cart
const rainDefenseIndex = this.cart.findIndex((vap) => { return !this.cart.some((vap) => {
return vap.partType.includes(" WIPER"); return vap.partType.includes(" WIPER");
}); });
return rainDefenseIndex > -1 ? false : true;
}, },
rainDefensePrice() { rainDefensePrice() {
const lineItem = this.rainDefenseItem; const lineItem = this.rainDefenseItem;