Merge pull request #1178 from Safelite/feature/CSR-1131

CSR-1131: fixes in case the state saved date is not in the list of selectableDatesData
This commit is contained in:
AdamCaouetteSafelite 2023-06-22 16:50:08 -04:00 committed by GitHub
commit 5e45ef0427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,8 +259,8 @@ export default {
getTimeSlotObjectFromTimeSlotId(timeSlotId) {
const timeSlots = this.selectableDatesData.days.find(
(selectableDate) => selectableDate.date === this.selectedDate
).timeSlots;
return timeSlots.find((timeSlot) => timeSlot.id === timeSlotId);
)?.timeSlots;
if (timeSlots) return timeSlots.find((timeSlot) => timeSlot.id === timeSlotId);
},
getSelectedDate() {
return store.getters.order.schedule.date;
@ -276,7 +276,7 @@ export default {
},
updateFooterButtonText(timeSlotData) {
let funnelFooterButtonText;
if (!timeSlotData.id) {
if (!timeSlotData.id || !this.appointmentDateAndTime) {
funnelFooterButtonText = "Continue";
} else {
funnelFooterButtonText =