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