Merge pull request #2700 from Safelite/feature/CASH-1209
Feature/CASH-1209
This commit is contained in:
commit
a208d12fc8
1 changed files with 11 additions and 10 deletions
|
|
@ -449,8 +449,6 @@ export default {
|
|||
);
|
||||
}
|
||||
|
||||
this.resetSelectedTimeSlotIfDateChange(timeSlotsForSelectedDate);
|
||||
|
||||
return availableTimeSlots;
|
||||
},
|
||||
getPremiumAppointmentTimeSlot(timeSlotData) {
|
||||
|
|
@ -548,15 +546,20 @@ export default {
|
|||
},
|
||||
resetSelectedTimeSlotIfDateChange(timeSlotsForSelectedDate) {
|
||||
if (this.selectedRouteCode) {
|
||||
const selectedRouteCodeString = this.selectedRouteCode.replace(
|
||||
PREMIUM_TIME_SLOT_ID_FLAG,
|
||||
""
|
||||
const selectedRouteCodeString = this.removePremiumFlagFromInput(
|
||||
this.selectedRouteCode
|
||||
);
|
||||
const matchingTimeSlot = timeSlotsForSelectedDate.find((slot) => {
|
||||
const availableTimeSlotsForSelectedDate =
|
||||
timeSlotsForSelectedDate.timeSlots || timeSlotsForSelectedDate;
|
||||
const matchingTimeSlot = availableTimeSlotsForSelectedDate.find((slot) => {
|
||||
return slot.id === selectedRouteCodeString;
|
||||
});
|
||||
if (!matchingTimeSlot) {
|
||||
this.resetSelectedTimeSlot();
|
||||
if (selectedRouteCodeString !== this.answersForDropOffQuestion[0].value) {
|
||||
this.resetSelectedTimeSlot();
|
||||
}
|
||||
} else {
|
||||
this.setSelectedTimeSlot();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -580,9 +583,7 @@ export default {
|
|||
},
|
||||
selectedDate: {
|
||||
handler() {
|
||||
this.resetSelectedTimeSlot();
|
||||
this.selectedAnswerForDropOffOrInshop = null;
|
||||
this.selectedAnswerForTimeSlots = null;
|
||||
this.resetSelectedTimeSlotIfDateChange(this.timeSlotsForSelectedDate);
|
||||
this.autoSelectTimeSlotIfOnlyOneIsAvailable();
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue