CSR-1131: fixes in case the state saved date is not in the list of selectableDatesData

This commit is contained in:
Adam Caouette 2023-06-22 16:28:13 -04:00
parent 026eff5ca2
commit e17cb0d5e6

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 =