From b6e9a7209f2113603b6e53e09395045e6580f1df Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 24 Jan 2022 22:40:35 +0100 Subject: [PATCH] Select appointment time from within the calendar when "all" select filter item is selected. --- assets/js/utils/calendar_default_view.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/assets/js/utils/calendar_default_view.js b/assets/js/utils/calendar_default_view.js index e1e11656..46b8c43f 100755 --- a/assets/js/utils/calendar_default_view.js +++ b/assets/js/utils/calendar_default_view.js @@ -1489,12 +1489,14 @@ App.Utils.CalendarDefaultView = (function () { (availableProvider) => Number(availableProvider.id) === Number($selectFilterItem.val()) ); - service = vars('available_services').find( - (availableService) => provider.services.indexOf(availableService.id) !== -1 - ); + if (provider) { + service = vars('available_services').find( + (availableService) => provider.services.indexOf(availableService.id) !== -1 + ); - if (service) { - $appointmentsModal.find('#select-service').val(service.id); + if (service) { + $appointmentsModal.find('#select-service').val(service.id); + } } if (!$appointmentsModal.find('#select-service').val()) {