WordPress Lazy Load

I can lazily load the pages I want. As soon as I select a category from the filter, the category I selected brings the products, but then it starts to load all the products, how can I prevent this?

Following my code : jQuery

jQuery(document).ready(function (){         let page = 1;         let action = 'inactive';         let params = JSON.parse('<?=json_encode($  params)?>');          let checkInput =  jQuery("input[name^='filter']:checked");         let checkInputVal =  jQuery("input[name^='filter']:checked").val();         if (jQuery(checkInput).is(':checked')) {                 params.show_category_filter='yes';             params.category_values=checkInputVal;             params.category=checkInputVal;         }          else if(jQuery(checkInput).not(':checked')) {             function load_country_data(page) {                 params.paged = page;                 params.action = 'test';                 console.log(params);                 jQuery.ajax({                     url: "https://techschuh.com/wp-admin/admin-ajax.php",                     method: "POST",                     data: params,                     cache: false,                      success: function (data) {                         let dataResponse = JSON.parse(data)                         //console.log(dataResponse.html);                         jQuery('.eltdf-masonry-list-wrapper').append(dataResponse.html);                                             if(dataResponse) {                             jQuery('#load_data_message').html("Please Wait.");                               action="inactive";                          } else  {                             alert("Data Not Found");                             action='active';                          }                     }                 });              }         }         if (action === 'inactive') {             action = 'active';             load_country_data(page);         }         jQuery(window).scroll(function () {             if (jQuery(window).scrollTop() + jQuery(window).height() > jQuery('#load_data').height() &&                 action == 'inactive') {                 action = 'active';                 page += 1                  setTimeout(function () {                     load_country_data(page);                 }, 500);             }          });     });