CSR-1384: minor alts to insure against console errors

This commit is contained in:
Adam Caouette 2023-10-27 16:40:24 -04:00
parent 4009be32fe
commit 4bbc508aad

View file

@ -215,17 +215,17 @@ export default {
if (!rainDefenseInCart) { if (!rainDefenseInCart) {
// NO RAIN DEFENSE IN CART; SHOW RAIN DEFENSE BUTTON // NO RAIN DEFENSE IN CART; SHOW RAIN DEFENSE BUTTON
const modalData = getAnswer("RainDefenseModal", this.answersCmsData); const modalData = getAnswer("RainDefenseModal", this.answersCmsData);
modalData.SubText = "+$" + this.rainDefenseModal.listPrice; modalData.SubText = "+$" + this.rainDefenseModal?.listPrice;
buttons.push(modalData); buttons.push(modalData);
} }
const modalData = getAnswer("WipersModal", this.answersCmsData); const modalData = getAnswer("WipersModal", this.answersCmsData);
if (!frontWipersInCart) { if (!frontWipersInCart) {
if (!rearWipersInCart && this.wipersModal.rearWiperLineItems.length > 0) { if (!rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) {
// NO REAR WIPERS or FRONT WIPERS IN CART; SHOW COMBO BUTTON // NO REAR WIPERS or FRONT WIPERS IN CART; SHOW COMBO BUTTON
const prices = [ const prices = [
this.wipersModal.totalFrontPrice, this.wipersModal?.totalFrontPrice,
this.wipersModal.totalRearPrice, this.wipersModal?.totalRearPrice,
]; ];
prices.sort((a, b) => a - b); prices.sort((a, b) => a - b);
modalData.SubText = "+$" + prices[0] + " - $" + prices[prices.length - 1]; modalData.SubText = "+$" + prices[0] + " - $" + prices[prices.length - 1];
@ -233,13 +233,13 @@ export default {
buttons.push(modalData); buttons.push(modalData);
} else { } else {
// NO FRONT WIPERS IN CART; SHOW ONLY FRONT WIPERS BUTTON // NO FRONT WIPERS IN CART; SHOW ONLY FRONT WIPERS BUTTON
modalData.SubText = "+$" + this.wipersModal.totalFrontPrice; modalData.SubText = "+$" + this.wipersModal?.totalFrontPrice;
this.updateWipersToDisplay(wipersToDisplayStrings.FRONT); this.updateWipersToDisplay(wipersToDisplayStrings.FRONT);
buttons.push(modalData); buttons.push(modalData);
} }
} else if (!rearWipersInCart && this.wipersModal.rearWiperLineItems.length > 0) { } else if (!rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) {
// NO REAR WIPERS IN CART; SHOW ONLY REAR WIPERS BUTTON // NO REAR WIPERS IN CART; SHOW ONLY REAR WIPERS BUTTON
modalData.SubText = "+$" + this.wipersModal.totalRearPrice; modalData.SubText = "+$" + this.wipersModal?.totalRearPrice;
this.updateWipersToDisplay(wipersToDisplayStrings.REAR); this.updateWipersToDisplay(wipersToDisplayStrings.REAR);
buttons.push(modalData); buttons.push(modalData);
} }