From 0a4ea1c336bc3067618c6248905f739a48a4eec9 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 10 Feb 2022 20:34:59 +0100 Subject: [PATCH] Only pre-select the service if its found --- assets/js/utils/calendar_default_view.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/utils/calendar_default_view.js b/assets/js/utils/calendar_default_view.js index 2fd24ed5..01507e4d 100755 --- a/assets/js/utils/calendar_default_view.js +++ b/assets/js/utils/calendar_default_view.js @@ -1546,13 +1546,15 @@ App.Utils.CalendarDefaultView = (function () { (availableService) => Number(availableService.id) === Number($selectFilterItem.val()) ); - $appointmentsModal.find('#select-service').val(service.id).trigger('change'); + + if (service) { + $appointmentsModal.find('#select-service').val(service.id).trigger('change'); + } } // Preselect time $('#start-datetime').datepicker('setDate', info.start); $('#end-datetime').datepicker('setDate', info.end); - $('#message-box').dialog('close'); } }