diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index cc0db6976..b16e16ecb 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -263,6 +263,7 @@ function verifyRepeatingFields(){ function loadOfferingsToModal(){ let offerings = JSON.parse($("#seriesData").val()) + if (offerings.length < 1) {return;} let isRepeatingStatus = $("#checkIsRepeating").is(":checked"); if (isRepeatingStatus) {$("#generatedEvents").removeClass("d-none"); $("#generatedEventsTable tbody tr").remove();}; offerings.forEach((offering, i) =>{ @@ -403,9 +404,12 @@ $(".startDatePicker").change(function () { modalOpenedByEditButton = ($(this).attr('id') === 'edit_modal'); if (isSeries) { - if (verifyRepeatingFields){ + if (verifyRepeatingFields()){ handleRepeatingEventsChange() } + else{ + $("#generatedEvents").addClass("d-none"); + } setViewForSeries(); loadOfferingsToModal(); $('#modalSeries').modal('show');