Fix: Considering the scenario when download does not have a data-tags attribute

This commit is contained in:
michalpokusa 2025-01-18 17:32:33 +01:00
parent 59ce4cd913
commit daa4770c37

View file

@ -353,7 +353,7 @@ function filterResults() {
// exact tag match re-order
if (downloadsSearch.searchTerm !== null && downloadsSearch.searchTerm !== undefined) {
let searched = downloadsSearch.searchTerm.toLowerCase();
let tags = download.getAttribute("data-tags").split(",");
let tags = download.dataset.tags?.split(",") || [];
if (searched !== "" && tags.indexOf(searched) >= 0) {
let parent = download.parentElement;
parent.removeChild(download);